非公開 TxRxs

  • /*
     * @title TxRxs
     * @description replace http to https
     * @include http://*
     * @include https://*
     * @license MIT License https://opensource.org/licenses/MIT
     * @javascript_url
     * @private WIP
     */
    
    (() => {
      'use strict';
    
      const wipe = (ctx) => {
        ctx.querySelectorAll([
          'a[href^="http:"]',
        ]).forEach(link => {
          //*
          link.protocol = 'https:';
    
          alert(link.href.trim())
          alert(link.textContent.trim())
    
          if (link.href.trim() === link.textContent.trim()) {
            link.textContent = link.href;
          }
          /*
          const s = new URL(link.href);
          s.href.protocol = 'https:';
          s.href = s.href.trim();
    
          if (link.href.trim() === link.textContent.trim()) {
            link.textContent = s.href;
          }
          
          link.href = s.href;
          */
          });
      };
    
      wipe(document.body);
    
      new MutationObserver(records => {
        records.forEach(record => {
            wipe(record.target);
        });
      }).observe(document.body, {
        childList: true,
        subtree: true,
      });
    })();
    
    /* from *dumb* phone */
    
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2022/01/03 03:19:45 - 2022-01-03
  2. 2018/07/25 07:58:22 - 2018-07-25
  3. 2018/07/24 09:11:46 - 2018-07-24
  4. 2018/07/24 09:10:04 - 2018-07-24
  5. 2018/07/23 06:29:05 - 2018-07-23
  6. 2018/07/22 08:20:30 - 2018-07-22
  7. 2018/07/22 08:16:36 - 2018-07-22
  8. 2018/05/31 00:33:21 - 2018-05-31
  9. 2018/05/31 00:32:16 - 2018-05-31
  10. 2018/05/30 07:50:21 - 2018-05-30
  11. 2018/05/19 17:41:09 - 2018-05-19
  12. 2018/05/19 17:35:13 - 2018-05-19
  13. 2018/05/19 17:22:58 - 2018-05-19
  14. 2018/05/11 05:48:13 - 2018-05-11
  15. 2018/05/11 05:16:41 - 2018-05-11
  16. 2018/05/11 05:08:50 - 2018-05-11