Greasy Fork

Greasy Fork is available in English.

ヤフオクで非表示とメモ

q:非表示 w:アンドゥ b:NGワード Shift+Q:NG編集 12:メモを追加 34:自由メモ 56:定型文をメモ Shift+!:メモを編集 Shift+":自動メモのみ全削除 Shift+#:メモを一時非表示 Shift+56:定型文を設定 .:上限価格 t:半透明モード

目前为 2022-01-07 提交的版本。查看 最新版本

// ==UserScript==
// @name ヤフオクで非表示とメモ
// @description q:非表示 w:アンドゥ b:NGワード Shift+Q:NG編集 12:メモを追加 34:自由メモ 56:定型文をメモ Shift+!:メモを編集 Shift+":自動メモのみ全削除 Shift+#:メモを一時非表示 Shift+56:定型文を設定 .:上限価格 t:半透明モード
// @match *://auctions.yahoo.co.jp/search/*
// @match *://page.auctions.yahoo.co.jp/jp/auction/*
// @match *://auctions.yahoo.co.jp/seller/*
// @match *://auctions.yahoo.co.jp/category/list/*
// @match *://cpu.userbenchmark.com/*
// @match *://webcomics.jp/*
// @match *://www.amazon.co.jp/*
// @exclude *://www.amazon.co.jp/*/cart/*
// @exclude *://www.amazon.co.jp/*/buy/*
// @exclude *://www.amazon.co.jp/*/huc/*
// @exclude *://www.amazon.co.jp/*/css/*
// @exclude *://www.amazon.co.jp/ap/*
// @exclude *://www.amazon.co.jp/gp/*
// @exclude *://www.amazon.co.jp/auto-deliveries*
// @match *://booklive.jp/index/no-charge*
// @match *://ebookjapan.yahoo.co.jp/free*
// @match *://ebookjapan.yahoo.co.jp/ranking/free/*
// @match *://ebookjapan.yahoo.co.jp/ranking/details/free/*
// @match *://ebookjapan.yahoo.co.jp/viewer*
// @match *://sokuyomi.jp/*
// @match *://csbs.shogakukan.co.jp/free*
// @match *://www.rtings.com/*/tools/table*
// @match *://www.rtings.com/*/reviews/*
// @match *://www.nicovideo.jp/search/*
// @match *://www.nicovideo.jp/tag/*
// @match *://www.nicovideo.jp/user/*
// @match *://www.nicovideo.jp/series/*
// @match *://www.nicovideo.jp/my/*
// @match *://www.nicovideo.jp/ranking/*
// @match *://*.5ch.net/*
// @match *://www.ebay.com/sch/*
// @match *://www.ebay.com/itm/*
// @match *://jmty.jp/*
// @match *://greasyfork.org/*/scripts*
// @match *://*.aliexpress.com/af/*
// @match *://*.aliexpress.com/item/*
// @match *://*.aliexpress.com/wholesale*
// @match *://www.cmoa.jp/freecontents*
// @match *://piccoma.com/*
// @match *://www.mangaz.com/*
// @match *://www.sukima.me/*
// @match *://*.userbenchmark.com/*
// @match *://www.hellowork.mhlw.go.jp/kensaku/*
// @match *://kakaku.com/*
// @match *://seiga.nicovideo.jp/*
// @match *://seiga.nicovideo.jp
// @match *://tsugimanga.jp/*
// @match *://www.yodobashi.com/*
// @match *://www.youtube.com/*
// @match *://*.iherb.com/*
// @match *://www.suruga-ya.jp/*
// @match *://twitter.com/*
// @match *://www.nicovideo.me/*
// @match *://www.nicochart.jp/*
// @match *://pubmed.ncbi.nlm.nih.gov/?term=*
// @match *://pubmed.ncbi.nlm.nih.gov/?linkname=*
// @match *://pubmed.ncbi.nlm.nih.gov/*
// @match *://a-timesale.com/*
// @match *://rrws.info/*
// @match *://commons.nicovideo.jp/*
// @match *://scholar.google.tld/*
// @match *://hibiki-radio.jp/*
// @match *://www.onsen.ag/
// @match *://www.freem.ne.jp/*
// @match *://shopping.yahoo.co.jp/search*
// @match *://the360.life/*
// @match *://omocoro.jp/*
// @match *://minsoku.net/*
// @match https://refind2ch.org/search*
// @match *://chiebukuro.yahoo.co.jp/*
// @match *://www.msdmanuals.com/*
// @match *://ff5ch.syoboi.jp/?q=*
// @match *://todo-ran.com/*
// @match *://booth.pm/*
// @match *://sakura-checker.jp/category/*
// @match https://chrome.google.com/webstore/search/*
// @match https://chrome.google.com/webstore/detail/*
// @match *://twicomi.com/*
// @match *://twiman.net/*
// @match *://free.arinco.org/*
// @match *://workman.jp/shop/*
// @match *://www.uniqlo.com/*
// @match *://*.shitaraba.net/bbs/read.cgi/*
// @match *://*.ftbucket.info/*
// @match *://kuzure.but.jp/*
// @match *://*.2chan.net/*
// @version     0.5.42
// @grant       GM_setValue
// @grant       GM_getValue
// @grant       GM_deleteValue
// @grant       GM_addStyle
// @run-at      document-idle
// @namespace http://greasyfork.icu/users/181558
// @require https://code.jquery.com/jquery-3.4.1.min.js
// ==/UserScript==

(function() {

  const ENABLE_EXCEPT_YAJ = 1; // 1:ヤフオク以外でも有効 0:ヤフオクでのみ動作
  const ENABLE_HELP = 1; // 1:操作ガイドを表示 0:無効
  const REPLACE_LINK_IN_YOUTUBE = 1; // 1:YouTubeで投稿者のチャンネルのホームタブへのリンクをチャンネルの動画タブへのリンクに置き換える
  const WCA_HIDE_SOME_SITES = 0; // (Web漫画アンテナで)1:使いにくい又は遅いサイト(コミックライド、マンガPark、コミックファイア、コミックヴァルキリー、まんがライフSTORIA´、がうがうモンスター、Z、スポバトマンガ研究所、WEBコミックガンマ、COMICリュウ、新都社、COMIC FUZ、COMICフルール、comicグラスト)の項目を隠す 0:無効
  const ENABLE_AUTOMEMO = 7; // 0:自動メモを無効 1でオン 2~7:大きくするほど一時的に表示が崩れる代わりに確実
  const fasttest = 1; // 1:高速モードを試用
  const KEYCHANGE_DEBUG = "disable"; // 押す度にdebugを0~3に切り替えるキー "Shift+D","disable"等
  var debug = 0;  // 1~だとデバッグモード dc(text) 1:コンソールにverbose表示 2:verboseをポップアップ(速度測定して表示 sw("項目"))&非表示にした原因に枠追加 3:Q/1/2等の対象要素を目立たせる
  const debug2 = 0; // 1だとデバッグモード 非対応ページでその旨表示など
  const SITES_TO_BE_HIDDEN = ["マンガPark", "コミックファイア", "コミックヴァルキリー", "まんがライフSTORIA´", "COMICメテオ", "がうがうモンスター", "Z", "スポバトマンガ研究所", "WEBコミックガンマ", "COMICリュウ", "新都社", "COMIC FUZ", "COMICフルール", "コミックライド", "comicグラスト", "マンガ5"]; // Web漫画アンテナで使いにくい、遅い等非表示にしたいサイトを書く
  const ENABLE_MEASURE_TIME_SPENT = 0; // 1で速度測定して表示 sw("項目")

  var swb = new Date();
  sw("reset") // = new Date();

  String.prototype.match0 = function(re) { let tmp = this.match(re); if (!tmp) { return "" } else if (tmp.length === 1) { return tmp[0] } else return tmp[1] } // thisにreがmatchすればその最初の文字列か最初のキャプチャ、なければ""
  $.fn.animate2 = function(properties, duration, ease) {
    ease = ease || 'ease';
    var $this = this;
    var cssOrig = { transition: $this.css('transition') };
    return $this.queue(next => {
      properties['transition'] = 'all ' + duration + 'ms ' + ease;
      $this.css(properties);
      setTimeout(function() {
        $this.css(cssOrig);
        next();
      }, duration);
    });
  };

  if (window != parent) return;
  const WAIT = performance.now(); // ページ開始後のウエイト用 delayAutoWeightingをかける
  const COLOR1 = "#6080ff",
    COLOR2 = "#c03020",
    COLOR3 = "#808080",
    COLOR5 = "#6080ff",
    COLOR6 = "#c03020",
    COLORCPUSCORE = "#a08000",
    KEYHIDE = "q",
    KEYUNDO = "w",
    KEYBW = "b",
    KEYEDIT = "Shift+Q",
    //    KEYEDIT2 = "Shift+B",
    KEYMAXP = ".",
    KEYMEMO1 = "1",
    KEYMEMO2 = "2",
    KEYMEMO1S = "3",
    KEYMEMO2S = "4",
    KEYMEMO5 = "5",
    KEYMEMO6 = "6",
    KEYMEMO5EDIT = "Shift+%",
    KEYMEMO6EDIT = "Shift+&",
    KEYTOGGLEtranslucent = "t",
    KEYRESETMEMO = "Shift+!",
    KEYRESETMEMOAUTO = "Shift+\"";
  var MEMO5WORD = "", // 5キーの定型文初期値 ""なら現在年月日
    MEMO6WORD = ""; // 6キーの定型文初期値 ""なら現在年月日

  var pauseAll = 0;

  // 上が優先
  const SITEINFO = [
    {
      id: 'ftbucket.info',
      urlRE: '//.*.ftbucket.info/|//kuzure.but.jp/|//[^.]+.2chan.net\/',
      listTitleXP: '//span[@class="cno"]',
      listTitleSearchXP: '//span[@class="cno"][+++]/../../../..',
      listTitleMemoSearchXP: '//span[@class="cno"][+++]',
      listGen: 5,
      detailURLRE: /$^/,
      detailTitleXP: '',
      detailTitleSearchXP: '',
      //WhateverFirstAndEveryAPFunc:(node=document)=>{elegeta('//a').forEach(e=>{e.href=e.href.replace(/http:\/\//,"https://")})},
      funcOnlyFirst: () => {
        elegeta('//div/input[@type="search" and @id="searchword"]').forEach(e => e.style.width = "calc(100% - 4em)")
        var popped = []
        // 引用ポップアップ仕込み
        var res = [];
        elegeta('//td[@class="rtd"]/span[@class="rsc"]').forEach(e => {
          res[e.textContent] = e.closest('td.rtd').outerHTML.replace(/class=\"rtd\"/, 'class=\"rtd2\"')
          e.closest('td.rtd').setAttribute("rsc", e.textContent)
        })
        var reso = [];
        elegeta('//td[@class="rtd"]/span[@class="rsc"]').forEach(e => { reso[e.textContent] = e.closest('td.rtd') });
        var resEnum = [];

        // 被引用を追記
        var cited = [];
        elegeta('//tr/td[@class="rtd"]/blockquote/font[contains(text(),">")]').forEach((h, i) => { //引用行文字列
          var resNumber = h.closest('.rtd').getAttribute("rsc") //引用されたレス全体
          var eWord = h.textContent.match0(/^\>+(.+)$/); //被引用文
          if (eWord) {
            var hit = res.findIndex(a => a && a.indexOf(eWord) != -1) //もとのレス番号
            if (hit && reso[hit]) {
              cited.push({ quote: hit, number: resNumber });
              if (cited.filter(a => a.quote == hit && a.number == resNumber).length <= 1) {
                $(reso[hit].parentNode).append($(`<font rsc="${hit}" rscf="${resNumber}" style="color:#789922; margin:0.25em;">&gt;&gt;${resNumber}</font>`))
                resEnum[hit] = (resEnum[hit] || "") + "<tr><td>" + res[resNumber] + "</td></tr>"
              }
            }
          }
        })

        // 引用ホバー
        GM_addStyle(".rtdAttract{background-color:#fed;}")
        var latestHover;
        setInterval(() => {
          var h = $("font:hover").get()
          var e = h.find(e => e.textContent.match(/^\>+.+$/));
          if (e && latestHover != e && e.className != "rtd2") {
            var eWord = e.textContent.match0(/^\>+(.+)$/); //被引用文
            if (eWord) {
              var hit = h[0].getAttribute("rsc");
              var hitstring = (!/\.2chan\./.test(new URL(location.href).hostname) && res.findIndex(a => a && a.indexOf(eWord) != -1))
              if ((hit || hitstring) && !eleget0(`//span[@class="ftbpu"][@data-anker="${hit}"]|//span[@class="ftbpu"][@data-anker="${hitstring}"]`)) {
                $("body").append($(`<span data-anker="${hit||hitstring}" class="ftbpu" style="z-index:1000; background-color:#F0e0d6; outline: 1px solid gray; outline-offset: -1px; position:absolute; left:${$(e).offset().left + $(e).outerWidth()/2}px; top:${$(e).offset().top+$(e).outerHeight()-1}px;"><table>${hit?resEnum[hit]:res[hitstring]}</table></span>`))
                reso[h[0].getAttribute("rscf") || hitstring].classList.add("rtdAttract")
                let eley = $(e).offset().top - $(window).scrollTop() + $(e).outerHeight() + 1;
                let marginheight = Math.min(window.innerHeight, document.documentElement.clientHeight) - eley
                let eleheight = $(".ftbpu").height()
                if (marginheight / eleheight > 0.6 && marginheight / eleheight < 1) $(".ftbpu").css({ "transform-origin": "top left" }).delay(100).animate2({ "transform": `scale(${marginheight/eleheight})`, "opacity": "1" }, 100)
              }
            }
          }
          if (h.length == 0 && ($(".ftbpu:hover").length == 0)) {
            $(".ftbpu").remove();
            $(".rtdAttract").removeClass("rtdAttract")
          }
          latestHover = e
        }, 17)
      },
    }, {
      id: 'www.uniqlo.com',
      urlRE: '//www.uniqlo.com/',
      listTitleXP: '//a/div[2]/h3',
      listTitleSearchXP: '//a/div[2]/h3[+++]/../../..',
      listTitleMemoSearchXP: '//a/div[2]/h3[+++]|//h1[@data-test="product-name"][+++]',
      listGen: 6,
      redoWhenReturned: 1,
      delay: 500,
      observe: 500,
      detailURLRE: /\/www.uniqlo.com\/jp\/ja\/products\//,
      detailTitleXP: '//h1[@data-test="product-name"]',
      detailTitleSearchXP: '//h1[@data-test="product-name"][+++]/../../..',
      urlHasChangedCommonFunc: () => {
        setTimeout(() => {
          isDetail = (SITE.detailURLRE && location.href.match(SITE.detailURLRE)) ? 1 : 0;
          run(document.body)
        }, 2000);
      },
    }, {
      id: 'workman',
      urlRE: '//workman.jp/shop/',
      listTitleXP: '//div[@class="block-thumbnail-t--goods-name"]/a|.//div[@class="_wrap"]/div[@class="_title"]/a',
      listTitleSearchXP: '//div[@class="block-thumbnail-t--goods-name"]/a[+++]/../../..|.//div[@class="_wrap"]/div[@class="_title"]/a[+++]/../../..',
      listTitleMemoSearchXP: '//div[@class="block-thumbnail-t--goods-name"]/a[+++]|//h1[@class="h1 block-goods-name--text js-enhanced-ecommerce-goods-name"][+++]|.//div[@class="_wrap"]/div[@class="_title"]/a[+++]',
      listGen: 4,
      observe: 500,
      detailURLRE: /shop\/g\//,
      detailTitleXP: '//h1[@class="h1 block-goods-name--text js-enhanced-ecommerce-goods-name"]',
      detailTitleSearchXP: '//h1[@class="h1 block-goods-name--text js-enhanced-ecommerce-goods-name"][+++]/../../../..',
    }, {
      id: 'free.arinco.org',
      urlRE: 'http://free.arinco.org/mail/index1.html',
      listTitleXP: '//a',
      useURL: 1,
      listTitleMemoSearchXPSameGen: 1,
      listGen: 4,
      listTitleSearchXP: '//a[++url++]/..',
      listTitleMemoSearchXP: '//a[++url++]',
    }, {
      id: 'free.arinco.org',
      urlRE: '//free.arinco.org/',
      useURL: 1,
      listTitleMemoSearchXPSameGen: 1,
      listGen: 4,
      listTitleXP: '//a|//h1/span[@itemprop="name"]',
      listTitleSearchXP: '//a[**url**]/..|//h1/span[@itemprop="name"][**url**]',
      listTitleMemoSearchXP: '//a[**url**]|//h1/span[@itemprop="name"][**url**]',
      funcOnlyFirst: function() {
        GM_addStyle('.itemlist li{height:auto; margin:0.5em;}');
        var e = location.href.replace(/^https?:\/\/free.arinco.org\/mail\/([^/]+\/)$/, "$1");
        var t = eleget0('//h1/span[@itemprop="name"]')
        if (document.body.innerText.match(/ホーム » Free Mail » /) && e && t) t.setAttribute("href", e)
      },
      automemoURLRE: /^https?:\/\/free.arinco.org\/mail\/[^/]+\/$/, // メールサービス名にホバーしないと作られない
      automemoSearchFunc: function() { return eletext(['//article[@role="main"]/section[@id="detail"]']); },
      automemoFunc: function() {
        [/(imap)/im, /(pop3)/mi, /(Tor)/m, /(e2ee)/m, /(openpgp)|(gnupgp)|(pgp)/mi].forEach(m => autoMemo(m));
      },
      automemoForceFunc: function() { return 1; },
      /*      autoTranslucentURLRE: /^https?:\/\/free.arinco.org\/mail\/[^/]+\/$/, // urlだけでは詳細概要画面を特定できない
            detailURLRE: /^https?:\/\/free.arinco.org\/mail\/.+/,
            detailTitleXP: '//h1/span[@itemprop="name"]',
            detailTitleSearchXP: '//h1/span[@itemprop="name"][**url**]/../../../..',
            automemoURLRE: /^https?:\/\/free.arinco.org\/mail\/[^/]+\/$/,
            automemoSearchFunc: () => { return eletext(['//article[@role="main"]/section[@id="detail"]']); },
            automemoFunc: () => {
                [/(imap)/im,/(pop3)/mi,/(openpgp)|(gnupgp)|(pgp)/mi].forEach(m => autoMemo(m));
              },
      */
    }, {
      id: 'twiman.net',
      urlRE: '//twiman.net/',
      listTitleXP: '//div[@class="v-list-item__content"]/div[2]',
      listTitleSearchXP: '//div[@class="v-list-item__content"]/div[2][***]/../../../..',
      listTitleMemoSearchXP: '//div[@class="v-list-item__content"]/div[2][***]/../..',
      listGen: 7,
      observe: 500,
      trim: 1,
    }, {
      id: 'twicomi.com',
      urlRE: '//twicomi.com',
      listTitleXP: '//div/div/div[@class="tweet-text"]|//div[@class="fixed-area"]/div[@class="fixed-tweet"]/div[@class="text"]',
      listTitleXP2: '//span[@class="screen-name"]|//div[@class="screen-name"]',
      XP2name: 'ユーザー名 ',
      XP2memo: 1,
      listTitleSearchXP: '//div/div/div[@class="tweet-text"][+++]/ancestor::div[@class="manga-item"]|//div[@class="fixed-area"]/div[@class="fixed-tweet"]/div[@class="text"][+++]|.//div[@class="screen-name"][+++]/..|.//span[@class="screen-name"][+++]/ancestor::div[@class="manga-item"]|.//div[@class="author-item"]/div[2]/dl/dd/span[@class="screen-name"][+++]/ancestor::div[contains(@class,"author-wrap")]|.//div[@class="content clearfix"]/div[@class="author-item"]/div[2]/dl/dd/span[@class="screen-name"][+++]/ancestor::div[@class="author-item"]',
      listTitleMemoSearchXP: '//div/div/div[@class="tweet-text"][+++]/..|//div[@class="fixed-area"]/div[@class="fixed-tweet"]/div[@class="text"][+++]|.//span[@class="screen-name"][+++]|.//div[@class="screen-name"][+++]|.//div[@class="author-item"]/div[2]/dl/dd/span[@class="screen-name"][+++]',
      listHelpXP: '//div/div/div[@class="tweet-text"]/ancestor::div[@class="manga-item"]|//div[@class="fixed-area"]/div[@class="fixed-tweet"]/div[@class="text"]/..',
      listGen: 8,
      //delay:2000,
      observe: 500,
      redoWhenReturned: 1,
      func: () => { $('.list').css({ "min-height": "0px" }) }, // AP継ぎ足し時の空白を詰める
      funcOnlyFirst: () => {
        var observeUrlHasChangedhref = location.href;
        var observeUrlHasChanged = new MutationObserver(mutations => {
          if (observeUrlHasChangedhref !== location.href) {
            pauseAll = 1;
            observeUrlHasChangedhref = location.href;
            elegeta('//span[contains(@class,"yhmMyMemo")]/..').forEach(e => e.remove());
            setTimeout(() => {
              pauseAll = 0;
              $(".phov2").remove();
              $('span.phov').remove();
              elegeta('//div[@class="fixed-area"]/div[@class="fixed-tweet"]/div[@class="text"]/..').forEach(e => e.style.opacity = "1")
              disableHide = (SITE.autoTranslucentURLRE && location.href.match(SITE.autoTranslucentURLRE)) || (pref("translucent") == "on");
              run(document.body, "returned")
            }, 100);
          }
        });
        observeUrlHasChanged.observe(document, { childList: true, subtree: true });
      },
      autoTranslucentURLRE: /\/\/twicomi\.com\/manga\//,
    }, {
      id: 'chrome.google.com/webstore/search/',
      urlRE: '//chrome.google.com/webstore/search/|//chrome.google.com/webstore/detail/',
      listTitleXP: '//div[@class="a-na-d-w" and @role="heading"]',
      listTitleSearchXP: '//div[@class="a-na-d-w" and @role="heading"][+++]/../../../../../..',
      listTitleMemoSearchXP: '//div[@class="a-na-d-w" and @role="heading"][+++]|.//div[@class="e-f-n-Va"]/div[@class="e-f-w-Va"]/h1[@class="e-f-w"][+++]',
      listGen: 7,
      delay: 2500,
      observe: 500,
      redoWhenReturned: 1,
      detailURLRE: /https:\/\/chrome.google.com\/webstore\/detail\//,
      detailTitleXP: '//div[@class="e-f-n-Va"]/div[@class="e-f-w-Va"]/h1[@class="e-f-w"]',
      detailTitleSearchXP: '//div[@class="e-f-n-Va"]/div[@class="e-f-w-Va"]/h1[@class="e-f-w"][+++]/../../../..',
      listTitleMemoSearchXPSameGen: 1,
    }, {
      id: 'sakura-checker.jp',
      urlRE: '//sakura-checker.jp/category/',
      listTitleXP: '//div[1]/figure/a',
      listTitleSearchXP: '//div[1]/figure/a[++url++]/../../..',
      listTitleMemoSearchXP: '//div[1]/figure/a[++url++]',
      listGen: 5,
      listHelpXP: '//div[1]/figure/a/../../..',
      useURL: 1,
    }, {
      /*
            id: 'BOOTH.PM', // 出品者名だけ
            urlRE: 'https:\/\/booth\.pm\/ja\/browse/|https:\/\/booth\.pm\/ja\/items|https:\/\/booth.pm\/ja$|https:\/\/booth\.pm\/ja\/events\/|https:\/\/booth\.pm\/ja\/search\/',
            //      listHelpXP: '//a[@class="item-card__title-anchor nav"]',
            listTitleXP: '//div[@class="item-card__shop-name"]',
            listTitleSearchXP: '//div[@class="item-card__shop-name"][+++]/../../../../../..',
            listTitleMemoSearchXP: '//div[@class="item-card__shop-name"][+++]|//div[@class="u-text-ellipsis"][+++]',
            listGen: 7,
            detailURLRE: /https:\/\/booth\.pm\/ja\/items\//,
            detailTitleXP: '//div[@class="u-text-ellipsis"]',
            detailTitleSearchXP: '//div[@class="u-text-ellipsis"][+++]/../../../../../../../..',
            redoWhenReturned: 1,
            hideListEvenDetail: 1,
      */
      id: 'BOOTH.PM', // 作者名でQ/1/2 出品者名でQ
      urlRE: 'https:\/\/booth\.pm\/ja\/browse/|https:\/\/booth\.pm\/ja\/items|https:\/\/booth.pm\/ja$|https:\/\/booth\.pm\/ja\/events\/|https:\/\/booth\.pm\/ja\/search\/',
      listHelpXP: '//a[@class="item-card__title-anchor nav"]/../../../..|.//a[@class="item-card__title-anchor--multiline nav"]/../../../..',
      listTitleXP: '//a[@class="item-card__title-anchor nav"]|.//a[@class="item-card__title-anchor--multiline nav"]',
      listTitleXP2: '//div[@class="item-card__shop-name"]|//div[@class="u-text-ellipsis"]|//a[@class="nav u-tpg-title2"]',
      XP2memo: 1,
      XP2name: '出品者名 ',
      listTitleSearchXP: '//a[@class="item-card__title-anchor nav"][+++]/../../../..|//div[@class="item-card__shop-name"][+++]/../../../../../..|.//a[@class="item-card__title-anchor--multiline nav"][+++]/../../../..',
      listTitleMemoSearchXP: '//a[@class="item-card__title-anchor nav"][+++]|//header/h2[@class="u-text-wrap u-tpg-title1 u-mt-0 u-mb-400"][+++]|.//a[@class="item-card__title-anchor--multiline nav"][+++]|.//div[@class="item-card__shop-name"][+++]|.//div[@class="u-text-ellipsis"][+++]|//a[@class="nav u-tpg-title2"][+++]',
      listGen: 7,
      detailURLRE: /https:\/\/booth\.pm\/ja\/items\//,
      detailTitleXP: '//header/h2[@class="u-text-wrap u-tpg-title1 u-mt-0 u-mb-400"]',
      detailTitleSearchXP: '//header/h2[@class="u-text-wrap u-tpg-title1 u-mt-0 u-mb-400"][+++]/../../../../../../../..|//div[@class="u-text-ellipsis"][+++]/../../../../../../../..',
      redoWhenReturned: 1,
      hideListEvenDetail: 1,
    }, {
      id: 'TOODORAN',
      urlRE: '//todo-ran.com/t/soukan/',
      listTitleXP: '//td/a[1]',
      listTitleSearchXP: '//td/a[1][+++]/../..',
      listTitleMemoSearchXP: '//td/a[1][+++]',
      listGen: 3,
      listTitleMemoSearchXPSameGen: 1,
    }, {
      id: 'FF5CH',
      urlRE: /\/\/ff5ch\.syoboi\.jp\/\?q=/,
      listTitleXP: '//a[@class="thread"]',
      listTitleSearchXP: '//a[@class="thread"][+++]/../..',
      listTitleMemoSearchXP: '//a[@class="thread"][+++]',
      listGen: 3,
    }, {
      id: 'MSDMANUAL', // 検索結果と詳細ページでは項目名に表記ゆれがあるので合致しない
      urlRE: '//www.msdmanuals.com/',
      listTitleXP: '//div/a[@class="search__result--title"]',
      listTitleSearchXP: '//div/a[@class="search__result--title"][+++]/../../..',
      listTitleMemoSearchXP: '//div/a[@class="search__result--title"][+++]|//h1[@class="topic__header__headermodify--title topic__header__headermodify--title--animate"][+++]',
      listGen: 3,
      delay: 2000,
      observe: 500,
      detailURLRE: /^(?!.*(SearchResults)).*/,
      detailTitleXP: '//h1[@class="topic__header__headermodify--title topic__header__headermodify--title--animate"]',
      detailTitleSearchXP: '//h1[@class="topic__header__headermodify--title topic__header__headermodify--title--animate"][+++]/../../../../../..',
    }, {
      id: 'CHIEBUKURO',
      urlRE: '//chiebukuro.yahoo.co.jp/',
      //  urlRE: /\/\/chiebukuro.yahoo.co.jp\/|\/\/detail.chiebukuro.yahoo.co.jp\//,
      listTitleXP: '//div/a/div/div/div/div/h2/../../../../..',
      listTitleSearchXP: '//article/div/a/div/div/div/div/h2/../../../../..[++url++]/../..',
      listTitleMemoSearchXP: '//article/div/a[++url++]/div/div/div/div/h2',
      listGen: 9,
      useURL: 1,
      redoWhenReturned: 1,
    }, {
      urlRE: 'https://refind2ch.org/search',
      id: '2CHTHREADLIST',
      listTitleXP: '//p[contains(@class,"thread_title")]',
      listTitleXP2: '//p/span[@class="board_clr_font_shitaraba"]|.//p/span[@class="board_clr_font_2chnet"]', // おーぷん板名は重複'|//p/span[@class="board_clr_font_open2chnet"]',
      XP2name: '板 ',
      listTitleSearchXP: '//p[contains(@class,"thread_title")][***]/../..|.//p/span[@class="board_clr_font_shitaraba"][***]/../../..|.//p/span[@class="board_clr_font_2chnet"][***]/../../..', //'|//p/span[@class="board_clr_font_open2chnet"][+++]/../../..',
      listTitleMemoSearchXP: '//p[contains(@class,"thread_title")][***]',
      listGen: 4,
      observe: 500,
      redoWhenReturned: 1,
      trim: 1,
      titleProcessFunc: (title) => { return title.replace(/\s\(したらば\)/gmi, "") },
      func: (node = document) => { // 高密度化&https化
        elegeta('//div/div[@class="container-fluid"]').forEach(e => {
          e.style.width = "95%";
          e.style.maxWidth = "100%";
        })
        elegeta('//div[@id="content_main"]').forEach(e => {
          e.style.width = "calc(95vw - 400px)";
          e.style.maxWidth = "100%";
        })
        elegeta('//div[@class="progress rate pull-right"]').forEach((e) => { e.style.width = "5%" });
        for (let element of elegeta('//div[@class="clearfix"]|//a[contains(@class,"thread_url list-group-item entry clearfix board_border board_clr_border_2chnet") and @target="_blank" and @rel="nofollow noreferrer"]/p')) {
          element.parentNode.href = element.parentNode.href.replace(/http:\/\//, "https://");
          element.style = "display:inline;float:left; margin:0px 0.0em; padding:0px 0.5em 0px 0.5em;";
        }
        for (let element of elegeta('//a[@rel="nofollow noreferrer"]')) element.style = "padding:0px;";
      },
    }, {
      id: 'KAKAKUBB',
      urlRE: '//kakaku.com/bb/',
      listTitleXP: '//a[@class="planName"]',
      listTitleSearchXP: '//a[@class="planName"][+++]/../../../../..',
      listTitleMemoSearchXP: '//a[@class="planName"][+++]',
      listGen: 3,
    }, {
      id: 'MINSOKU',
      urlRE: '//minsoku.net/',
      listTitleXP: '//div/div[@class="text-bold mt-xxs"]/a|.//div/div[@class="mt-10 text-bold"]/a|.//div[@class="mt-10 mb--xxxs text-bold"]/a',
      listTitleSearchXP: '//div/div[@class="text-bold mt-xxs"]/a[+++]/../../..|.//div/div[@class="mt-10 text-bold"]/a[+++]/../../..|.//div[@class="mt-10 mb--xxxs text-bold"]/a[+++]/../../..',
      listTitleMemoSearchXP: '//div/div[@class="text-bold mt-xxs"]/a[+++]|.//div/div[@class="mt-10 text-bold"]/a[+++]|.//div[@class="mt-10 mb--xxxs text-bold"]/a[+++]',
      listGen: 4,
    }, {
      id: 'OMOCORO',
      urlRE: '//omocoro.jp/',
      listTitleXP: '//div[@class="details"]/div[@class="title"]/a',
      listTitleSearchXP: '//div[@class="details"]/div[@class="title"]/a[+++]/../../..',
      listTitleMemoSearchXP: '//div[@class="details"]/div[@class="title"]/a[+++]',
      listGen: 4,
    }, {
      id: 'THE360LIFE',
      urlRE: '//the360.life/',
      listTitleXP: '//a/div/div[contains(@class,"s-ls2_title")]/pre',
      listTitleSearchXP: '//a/div/div[contains(@class,"s-ls2_title")]/pre[+++]/../../../..',
      listTitleMemoSearchXP: '//a/div/div[contains(@class,"s-ls2_title")]/pre[+++]|//div[@class="art-dtl-txt"]/h1[@class="art-dtl-txt1"][+++]',
      listGen: 5,
      detailURLRE: /\/\/the360\.life\/U1301/,
      detailTitleXP: '//div[@class="art-dtl-txt"]/h1[@class="art-dtl-txt1"]',
      detailTitleSearchXP: '//div[@class="art-dtl-txt"]/h1[@class="art-dtl-txt1"][+++]/../../..',
      redoWhenReturned: 1,
      observe: 1000,
    }, {
      id: 'SHOPPING_YAHOO',
      urlRE: '//shopping.yahoo.co.jp/search',
      listTitleXP: '//div[2]/p/a[@target="_blank" and @data-rapid_p="1"]/span',
      listTitleSearchXP: '//div[2]/p/a[@target="_blank" and @data-rapid_p="1"]/span[+++]/../../../../..',
      listTitleMemoSearchXP: '//li[@class="LoopList__item"]/div/div[2]/p/a[@target="_blank" and @data-rapid_p="1"]/span[+++]',
      listGen: 6,
      func: () => { // 商品名を省略しなくする
        elegeta('//div[2]/p/a[@target="_blank" and @data-rapid_p="1"]/span/..').forEach(e => {
          e.style.display = "block";
          e.style.maxHeight = "none";
        });
      },
      observe: 1000,
    }, {
      id: 'FREEM',
      urlRE: '//www.freem.ne.jp/',
      listTitleXP: '//a/h3[@class="pc"]',
      listTitleSearchXP: '//ul[contains(@class,"game-list game-list-wrap row")]/li/a/h3[@class="pc"][+++]/../..',
      listTitleMemoSearchXP: '//ul[contains(@class,"game-list game-list-wrap row")]/li/a/h3[@class="pc"][+++]',
      listGen: 3,
    }, {
      id: 'ONSEN',
      urlRE: '//www.onsen.ag/',
      listTitleXP: '//h4[@class="title"]',
      listTitleSearchXP: '//h4[@class="title"][+++]/../..',
      listTitleMemoSearchXP: '//h4[@class="title"][+++]',
      listGen: 4,
      observe: 500,
    }, {
      id: 'HIBIKI',
      urlRE: '//hibiki-radio.jp',
      listTitleXP: '//div[@class="title program-title-animate ng-binding"]',
      listTitleSearchXP: '//div[@class="title program-title-animate ng-binding"][+++]/../../..',
      listTitleMemoSearchXP: '//div[@class="title program-title-animate ng-binding"][+++]',
      listGen: 3,
      observe: 500,
    }, {
      id: 'GOOGLE_SCHOLAR',
      urlRE: '//scholar\.google\..*/',
      listTitleXP: '//h3[@class="gs_rt"]/a',
      listTitleSearchXP: '//h3[@class="gs_rt"]/a[++url++]/../../..',
      listTitleMemoSearchXP: '//h3[@class="gs_rt"]/a[++url++]',
      listGen: 3,
      useURL: 1,
      disableKeyB: 1,
    }, {
      id: 'NICODOUGA',
      urlRE: '//commons.nicovideo.jp/',
      listTitleXP: '//a[@class="title_link"]',
      listTitleSearchXP: '//a[@class="title_link"][+++]/..',
      listTitleMemoSearchXP: '//a[@class="title_link"][+++]', // ちゃんと動かない
      listGen: 2,
      observe: 500,
    }, {
      id: 'RRWS',
      urlRE: '//rrws.info/',
      listTitleXP: '//h2[@class="entry-card-title card-title e-card-title"]',
      listTitleSearchXP: '//h2[@class="entry-card-title card-title e-card-title"][***]/../../..',
      listTitleMemoSearchXP: '//h2[@class="entry-card-title card-title e-card-title"][***]|//h1[@class="entry-title"][***]',
      listGen: 3,
      detailURLRE: /rrws.info\/archives\//,
      detailTitleXP: '//h1[@class="entry-title"]',
      detailTitleSearchXP: '//h1[@class="entry-title"][***]/../..',
      trim: 1,
    }, {
      id: 'A-TIMESALE',
      urlRE: '//a-timesale.com/',
      listTitleXP: '//div[3]/div[@class="border-b pb-3 mb-4"]/a[@target="_blank"]',
      listTitleSearchXP: '//div[3]/div[@class="border-b pb-3 mb-4"]/a[@target="_blank"][+++]/../../../../..',
      listTitleMemoSearchXP: '//div[3]/div[@class="border-b pb-3 mb-4"]/a[@target="_blank"][+++]',
      listGen: 6,
      observe: 500,
    }, {
      id: 'PUBMED',
      //      urlRE: '//pubmed.ncbi.nlm.nih.gov/.term=',
      urlRE: '//pubmed.ncbi.nlm.nih.gov/.term=|//pubmed.ncbi.nlm.nih.gov/.linkname=|//pubmed.ncbi.nlm.nih.gov/',
      listTitleXP: '//span[@class="docsum-pmid" and text()]|.//span[@class="docsum-pmid"]/font[1]/font[1]',
      listHelpXP: '//span[@class="docsum-pmid" and text()]/../../../../..|.//span[@class="docsum-pmid"]/font/font/../../../../../../..',
      listTitleSearchXP: '//span[@class="docsum-pmid"][+++]/../../../../..|.//span[@class="docsum-pmid"]/font/font[+++]/../../../../../../..',
      listTitleMemoSearchXP: '//span[@class="docsum-pmid"][+++]|.//span[@class="docsum-pmid"]/font/font[+++]|//header[@id="heading"]/div[1]/ul/li/span/strong[@class="current-id"][+++]|//strong[@class="current-id"]/font/font[+++]/../..',
      observe: 500,
      listGen: 7,
      trim: 1,
      detailURLRE: /\/\/pubmed.ncbi.nlm.nih.gov\/\d*\//,
      detailTitleXP: '//header[@id="heading"]/div[1]/ul/li/span/strong[@class="current-id"][1]|//strong[@class="current-id"][1]/font[1]/font[1]',
      detailTitleSearchXP: '//header[@id="heading"]/div[1]/ul/li/span/strong[@class="current-id"][+++]/../../../../../..|//strong[@class="current-id"][1]/font[1]/font[1][+++]/../../../../../../../..',
      useText: 1,
    }, {
      id: 'NICOCHART',
      urlRE: '//www.nicochart.jp/',
      listTitleXP: '//li[@class="title"]/a',
      listTitleSearchXP: '//li[@class="title"]/a[+++]/../../../../..',
      listTitleMemoSearchXP: '//li[@class="title"]/a[+++]',
      listGen: 5,
      redoWhenReturned: 1,
    }, {
      id: 'NICOCHART',
      urlRE: '//www.nicovideo.me/',
      listTitleXP: '//h3[@class="fxs mtxs"]/a',
      listTitleSearchXP: '//h3[@class="fxs mtxs"]/a[+++]/../../..',
      listTitleMemoSearchXP: '//h3[@class="fxs mtxs"]/a[+++]',
      listGen: 3,
      redoWhenReturned: 1,
    }, {
      id: 'TWITTER',
      urlRE: '//twitter.com/',
      listTitleXP: '//a/div/div[2]/div[@dir="ltr"]/span',
      listTitleSearchXP: '//div[2]/div[@dir="ltr"]/span[+++]/../../../../../../../../../../../../../../..',
      listTitleMemoSearchXP: '//div[2]/div[@dir="ltr"]/span[+++]',
      listGen: 14,
      observe: 500,
      disableHelpForce: 1,
    }, {
      id: 'SURUGAYA',
      urlRE: '//www.suruga-ya.jp/',
      listTitleXP: '//p[@class="title"]/a[1]',
      listTitleSearchXP: '//p[@class="title"]/a[1][+++]/../../..',
      listTitleMemoSearchXP: '//p[@class="title"]/a[1][+++]',
      listGen: 5,
      //      titleProcessFunc: (title) => { return title.replace(/ランクB\)/gmi, "").replace(/(.*$|\(.*$/g, "").replace(/全??\d+巻セット.*$|全?\d+?~?\d+巻セット.*$/gmi, "").replace(/\s\/.*$/gmi, "").trim() },
      redoWhenReturned: 1,
      funcOnlyFirst: function() {
        if (location.href == "https://www.suruga-ya.jp/pcmypage/action_nyuka_search/list") {
          setupbutton("zaiko", "品切れの項目を非表示", () => {
            setInterval(() => { elegeta('//div[last()]/input[@value="再入荷通知する"]/../../../..').forEach(e => e.style.display = "none") }, 500);
          }, "もとに戻すにはリロード", "removeWhenClicked")
        }
        /*          $(document).keypress(k=>{
                  if(k.key=="1"){ setInterval(()=>{elegeta('//div[last()]/input[@value="再入荷通知する"]/../../../..').forEach(e=>e.style.display="none") },999);}
                  if(k.key=="2"){ elegeta('//div[last()]/input[@value="再入荷通知する"]/../../../..').forEach(e=>e.style.display="block")}
                  });
        */
      },
    }, {
      id: 'YOUTUBE',
      //      helpOnDNI: 1,
      urlRE: '//www.youtube.com/$|//www.youtube.com/results|//www.youtube.com/channel/|//www.youtube.com/playlist|//www.youtube.com/c/|//www.youtube.com/user/|//www.youtube.com/watch\?',
      disableUrlRE: /\/\/www\.youtube\.com\/watch\?/,
      listHelpXP: '//div[@id="dismissible"]|//div[@class="style-scope ytd-playlist-video-renderer"]/h3[@class="style-scope ytd-playlist-video-renderer"]/a/../../../../..',
      listTitleXP: '//a/yt-formatted-string[@class="style-scope ytd-video-renderer"]/..|.//a[@id="video-title"]|.//h3/span[@id="video-title"]|.//a[@id="video-title-link"]/yt-formatted-string[@id="video-title"]|.//yt-formatted-string[@id="video-title" and @class="style-scope ytd-rich-grid-media"]',
      //listTitleSearchXP: '//yt-formatted-string[@id="video-title" and +++]/../../../../../../../../div[@id="content"]/..|.//yt-formatted-string[@class="style-scope ytd-channel-name complex-string"]/a[+++]/../../../../../../../../../../../../../../div[@id="content"]/..|.//a[@id="video-title" and +++]/../../../../../div[@id="dismissible"]/..|//div/div/ytd-channel-name[@wrap-text=""]/div/div/yt-formatted-string[+++]/following::a|//a[@id="video-title" and ++title++]/../../../../../div[@id="content"]/..|.//a[@id="video-title"]/yt-formatted-string[+++]/../../../../../../../div[@id="dismissible"]/..|.//yt-formatted-string[@class="style-scope ytd-channel-name"]/a[+++]/../../../../../../../../div[@id="dismissible"]/..|.//h3/span[@id="video-title"][+++]/../..|.//div[@class="style-scope ytd-channel-name"]/yt-formatted-string[+++]/../../../../../../../../../../../..', // 新旧UI、縦横(高速化)// 再生リストだけtext中にゴミスペースがあるので++title++が必要 これを無視してよければ高速化できる 再生ページの右端のも消す
      listTitleSearchXP: '//yt-formatted-string[@id="video-title" and +++]/../../../../../../../../div[@id="content"]/..|.//yt-formatted-string[@class="style-scope ytd-channel-name complex-string"]/a[+++]/../../../../../../../../../../../../../../div[@id="content"]/..|.//a[@id="video-title" and +++]/../../../../../div[@id="dismissible"]/..|//div/div/ytd-channel-name[@wrap-text=""]/div/div/yt-formatted-string[+++]/following::a|//a[@id="video-title" and +++]/../../../../../div[@id="content"]/..|.//a[@id="video-title"]/yt-formatted-string[+++]/../../../../../../../div[@id="dismissible"]/..|.//yt-formatted-string[@class="style-scope ytd-channel-name"]/a[+++]/../../../../../../../../div[@id="dismissible"]/..', // 新旧UI、縦横(高速化)// 再生リストだけtext中にゴミスペースがあるのでrun時のfuncでゴミを消す処理が必要 高速 再生ページの右端のを消さない
      //      listTitleMemoSearchXP: '//a/yt-formatted-string[@class="style-scope ytd-video-renderer"][+++]|.//a[@id="video-title"][+++]|.//h3/span[@id="video-title"][++title++]|.//a[@id="video-title-link"]/yt-formatted-string[@id="video-title"][+++]', // 視聴ページの右柱にメモ
      listTitleMemoSearchXP: '//a/yt-formatted-string[@class="style-scope ytd-video-renderer"][+++]|.//a[@id="video-title"][+++]|.//a[@id="video-title-link"]/yt-formatted-string[@id="video-title"][+++]',
      //      listHelpXP: '//a[@class="yt-simple-endpoint style-scope ytd-grid-video-renderer"]/../../../..|//yt-formatted-string[@id="video-title"]',
      XP2name: '投稿者名 ',
      //XP2memo:1, // 投稿者にメモ可は重そう
      listTitleXP2: '//ytd-item-section-renderer[@class="style-scope ytd-section-list-renderer" and @use-height-hack=""]/div[3]/ytd-video-renderer[@class="style-scope ytd-item-section-renderer" and @use-prominent-thumbs=""]/div[@id="dismissible" and @class="style-scope ytd-video-renderer"]/div/div/ytd-channel-name[@id="channel-name" and @class="long-byline style-scope ytd-video-renderer" and @wrap-text="true"]/div[@id="container"]/div[@id="text-container" and @class="style-scope ytd-channel-name"]/yt-formatted-string[@id="text" and @class="style-scope ytd-channel-name"]/a|.//div[@class="byline style-scope ytd-rich-grid-media"]/ytd-video-meta-block[@rich-meta="" and @mini-mode=""]/div[@class="style-scope ytd-video-meta-block"]/div[@class="style-scope ytd-video-meta-block"]/ytd-channel-name/div[@class="style-scope ytd-channel-name"]/div[@class="style-scope ytd-channel-name"]/yt-formatted-string[@id="text" and @class="style-scope ytd-channel-name complex-string"]/a[@class="yt-simple-endpoint style-scope yt-formatted-string" and @spellcheck="false" and @dir="auto"]|//div[@id="meta" and @class="style-scope ytd-c4-tabbed-header-renderer"]/ytd-channel-name/div[@class="style-scope ytd-channel-name"]/div[@id="text-container" and @class="style-scope ytd-channel-name"]/yt-formatted-string[@id="text" and @class="style-scope ytd-channel-name"]|.//ytd-channel-name[@id="channel-name" and @class="style-scope ytd-video-meta-block"]/div[@id="container"]/div[@class="style-scope ytd-channel-name"]/yt-formatted-string[@class="style-scope ytd-channel-name complex-string" and @ellipsis-truncate=""]/a[@class="yt-simple-endpoint style-scope yt-formatted-string" and @dir="auto"]|.//ytd-channel-name[@id=\"channel-name\" and @wrap-text=\"true\"]/div[@class=\"style-scope ytd-channel-name\"]/div/yt-formatted-string/a',
      //listHelpXP2:'//h1[@class="title style-scope ytd-video-primary-info-renderer"]/yt-formatted-string',
      //      redoWhenReturned: 1,
      listGen: 7,
      observe: 500,
      observeId: "dismissible",
      disableKeyB: 1,
      funcOnlyFirst: () => {
        var observeUrlHasChangedhref = location.href;
        var observeUrlHasChanged = new MutationObserver(mutations => {
          if (observeUrlHasChangedhref !== location.href) {
            pauseAll = 1;
            observeUrlHasChangedhref = location.href;
            elegeta('//span[contains(@class,"yhmMyMemo")]/..').forEach(e => e.remove());
            //elegeta('//ytd-video-renderer|//*[@id="dismissible"]|//span[contains(@class,"yhmMyMemo")]/..').forEach(e => e.remove());
            //            setTimeout(() => { elegeta('//span[contains(@class,"yhmMyMemo")]').forEach(e => e.parentNode.remove());pauseAll=0;run(document.body, "returned") }, 3500);
            setTimeout(() => {
              pauseAll = 0;
              run(document.body, "returned")
            }, 3500);
          }
        });
        observeUrlHasChanged.observe(document, { childList: true, subtree: true });
      },
      func: function(node = document.body) {
        if (location.href.indexOf("https://www.youtube.com/playlist?list=") !== -1) { elegeta('//a[@id="video-title"]').forEach(e => { e.innerText = e.title; }); } // 再生リストだけテキストにゴミスペースがある
        if (REPLACE_LINK_IN_YOUTUBE) {
          elegeta('//a', node).forEach(e => { if (/\/(channel|user|c)\/[^\/]+$/.test(e.href)) e.href = e.href + "/videos"; });
        }
      },
      //      helpOnDNI:1,
      redoWhenReturned: 1,
    }, {
      id: 'IHERB',
      urlRE: '//.*.iherb.com/',
      listTitleXP: '//div[@class="absolute-link-wrapper"]/a',
      listTitleSearchXP: '//div[@class="absolute-link-wrapper"]/a[++title++]/../../..',
      listTitleMemoSearchXP: '//div[@class="absolute-link-wrapper"]/a[++title++]|.//section[3]/div/h1[@id="name" and +++]',
      listGen: 3,
      detailURLRE: /iherb.com\/pr\//,
      detailTitleXP: '//section[3]/div/h1[@id="name"]',
      detailTitleSearchXP: '//section[3]/div/h1[@id="name" and +++]/../../../../..',
      func: () => { { GM_addStyle('.product-column .product { height: auto; min-height:395px; }'); } }, // 商品ブロックの縦幅固定をやめる
    }, {
      id: 'YODOBASHI',
      urlRE: '//www.yodobashi.com/',
      listTitleXP: '//div[@class="pName fs14"]/p[2]|.//div[@class="product js_productName"]',
      listTitleSearchXP: '//div[@class="pName fs14"]/p[2][+++]/../../..|.//div[@class="product js_productName" and +++]/../../..|.//div[@class="product js_productName" and +++]/../../../../..',
      listTitleMemoSearchXP: '//div[@class="pName fs14"]/p[2][+++]|.//div[3]/h1[@id="products_maintitle"]/span[1][+++]|.//div[@class="product js_productName" and +++]|.//div[@class="product js_productName"][+++]',
      listGen: 4,
      listHelpXP: '//div[@class="pName fs14"]/p[2]/../../..',
      detailURLRE: /\/www.yodobashi.com\/product\//,
      detailTitleXP: '//div[3]/h1[@id="products_maintitle"]/span[1]',
      detailTitleSearchXP: '//div[3]/h1[@id="products_maintitle"]/span[1][+++]/../../../../..',
      hideListEvenDetail: 1,
      observe: 500,
      automemoURLRE: /^https:\/\/www.yodobashi.com\/product\//,
      automemoSearchFunc: () => { return eletext(['//div[@id="pinfo_productSummury"]', '//div[@id="productSet1Box"]', '//div[@class="specBox"]', '//h1[@class="pName js_variHeight"]/span[1]']); },
      automemoFunc: () => {
        var cat = elegeta('//div[@class="txtnav clearfix"]');
        if ((cat.some(e => /ヘルス&ビューティー/.test(e.innerText)))) {
          [/(イソプロピルメチルフェノール)/m, /(IPMP)/m, /(塩化セチルピリジニウム|塩化セシルピリジニウム|セチルピリジニウム塩化物)/m, /(CPC)/m, /(塩化ベンザルコニウム)/m, /(BKC)/m, /(ラウロイルサルコシンナトリウム|ラウロイルサルコシンNa|ラウロイルサルコシンNa)/m, /(LSS)/m, /(塩化ベンゼトニウム)/m, /(BTC)/m, /(クロルヘキシジン)/m, /(CHG)/m, /(グリチルリチン酸アンモニウム)/m, /(イプシロン.アミノカプロン酸)/m, /(ε.ACA)/m, /(トラネキサム酸)/m, /(TXA)/m, /(グリチルリチン酸ジカリウム|グリチルリチン酸二カリウム|グリチルリチン酸2K|グリチルリチン酸2K|GK2)/mi, /(1\,?450\s?ppm)/m, /(高?濃?度?フッ化ナトリウム|高?濃?度?フッ素)/m, /(ハイドロオ?キシアパタイト)/m, /(リン酸化オリゴ糖カルシウム)/m, /(POs-Ca|POs-Ca)/mi, /(カゼインホスホペプチド.非結晶性リン酸カルシウム|リカルデント)/m, /(CPP-ACP)/m, /(チモール)/m, /(サリチル酸メ?チ?ル?)/m, /(1\,8-シネオール)/m, /(トリクロサン)/m, /(トリクロカルバン)/m, /(オクトピロックス|ピロクトン.?オラミン)/m, /(Znピリチオン|ジンクピリチオン)/m, /(硫黄|イオウ)/m, /(アラントイン)/m, /(グリチルリチン酸アンモニウム)/m, /(ミコナゾール硝?酸?塩?)/m, /(クロラムフェニコール)/m, /(フラジオマイシン硫?酸?塩?)/m, /(ナイスタチン)/m, /(塩化亜鉛)/m, /(ポビドン.?ヨード)/m, /(ラウリルジアミノエチルグリシンナトリウム)/m, /(カキタンニン)/m, /(チャエキス)/m, /(ローズマリー)/m, /(カンゾウ)/m, /(クマザサ)/m, /(セージ)/m, /(シソエキス)/m, /(β?-?グリチルレチン酸?)/m, /(メントール)/m, /(ポリリン酸ナトリウム|ポリリン酸Na)/m, /(ヒノキチオール)/m, /(ティーツリー油オ?イ?ル?)/m, /(ティートゥリー油オ?イ?ル?)/m].forEach(m => autoMemo(m));
        }
        if ((cat.some(e => /浄水器/.test(e.innerText)))) {
          //          [/([0-90-9++].*?物質)/m, /(除?去?物質.{0,19}[0-90-9++]+)/m, /([0-90-9++]+?項目)/gm,/(交換.{1,19}[0-9.]+ヶ月)|(交換.{1,19}[0-9.]+年)|(取替.{1,19}[0-9.]+ヶ月)|(取替.{1,19}[0-9.]+年)/m].forEach(m => autoMemo(m)); //,/(除去物質数[\s\S]*\d+)/gm
          [/([0-90-9++].*?物質)/m, /([0-90-9++]+?項目)/gm, /(交換.{1,19}[0-9.]+ヶ月)|(交換.{1,19}[0-9.]+年)|(取替.{1,19}[0-9.]+ヶ月)|(取替.{1,19}[0-9.]+年)/m].forEach(m => autoMemo(m)); //,/(除去物質数[\s\S]*\d+)/gm
        }
        if ((cat.some(e => /電池/.test(e.innerText)))) {
          [/([\d\s\,]+mAh)/m, /([\d\s\,]+mAh)/m, /([\d\s\,]{2,9}回)/m].forEach(m => autoMemo(m));
        }
        if ((cat.some(e => /食器/.test(e.innerText)))) {
          [/(?:寸法|サイズ).*[::](.+)$/m, /容量[::](.+$)/m, /生産国[::](.+$)/m, /(深さ.*[::].+$)/m, /(\dつ穴)/m].forEach(m => autoMemo(m));
        }
        if ((cat.some(e => /シュレッダー/.test(e.innerText)))) {
          [/(細断サイズ[\s\S]{0,9}[0-9.]+×?[0-9.]*m?m?)/m, /ダストボックス(容量[\s\S]{0,9}[0-9.]+L)/m].forEach(m => autoMemo(m));
        }
      },
      redoWhenReturned: 1,
    }, {
      id: 'TSUGIMANGA',
      urlRE: '//tsugimanga.jp/',
      listTitleXP: '//div/div[@class="work__title"]',
      listTitleSearchXP: '//div/div[@class="work__title"][+++]/../..',
      listTitleMemoSearchXP: '//div/div[@class="work__title" and +++]',
      listGen: 5,
    }, {
      id: 'NICOSEIGA_COMIC',
      //        urlRE: /\/\/seiga.nicovideo.jp\/comic\/|\/\/seiga.nicovideo.jp\/watch\//,
      urlRE: /\/\/seiga.nicovideo.jp\/comic\//,
      listTitleXP: '//div[@class="title"]/a',
      listTitleSearchXP: '//div[@class="title"]/a[+++]/../../../..',
      listTitleMemoSearchXP: '//div[@class="title"]/a[+++]|//div/div/div/div[@class="title"]/h1/span[last()][+++]',
      listHelpXP: '//div[@class="title"]/a/../../..',
      listGen: 4,
      //listTitleMemoSearchXPSameGen: 1,
      detailURLRE: /\/\/seiga.nicovideo.jp\/watch\//,
      detailTitleXP: '//div/div/div/div[@class="title"]/h1/span[last()]',
      detailTitleSearchXP: '//div/div/div/div[@class="title"]/h1/span[last()][+++]/../../../../../..',

    }, {
      id: 'NICOSEIGA',
      urlRE: '//seiga.nicovideo.jp/illust/ranking/point/',
      listGen: 5,
      // 項目名:投稿者名
      listTitleXP: '//span[@class="rank_txt_user"]/a',
      listTitleSearchXP: '//span[@class="rank_txt_user"]/a[+++]/../../../../../..',
      listTitleMemoSearchXP: '//span[@class="rank_txt_user"]/a[+++]',
      listHelpXP: '//tr/td[contains(@class,"rank_block_right rank_no_")]',
    }, {
      id: 'NICOSEIGA',
      urlRE: '//seiga.nicovideo.jp/tag/|//seiga.nicovideo.jp/seiga/|//seiga.nicovideo.jp/user/illust/|//seiga.nicovideo.jp/illust/|//seiga.nicovideo.jp|//seiga.nicovideo.jp/my/personalize',
      listGen: 5,
      detailURLRE: /\/\/seiga.nicovideo.jp\/seiga\/|\/\/seiga.nicovideo.jp\/user\/illust\//,
      // 項目名:投稿者名
      listTitleXP: '//li[@class="user"]|.//span[@class="rank_txt_user"]/a|.//span[@class="popular_illust_block__item__info--nickname"]|.//p[@class="info_source"]/a[@class="user_name"]',
      listTitleSearchXP: '//li[@class="user" and +++]/../../..|.//span[@class="rank_txt_user"]/a[+++]/../../../..|.//span[@class="popular_illust_block__item__info--nickname" and +++]/../../..|.//p[@class="info_source"]/a[@class="user_name" and +++]/../../..',
      hideListEvenDetail: 1,
      listTitleMemoSearchXP: '//li[@class="user" and +++]/..|//ul/li[@class="user_name"]/strong[+++]/..|.//span[@class="nickname" and +++]/..|.//span[@class="rank_txt_user"]/a[+++]|.//span[@class="popular_illust_block__item__info--nickname" and +++]|.//p[@class="info_source"]/a[@class="user_name" and +++]',
      listHelpXP: '//li[contains(@class,"list_item list_no_trim2")]/a|.//tbody/tr/td[contains(@class,"rank_list_block rank_no_")]|.//div[@class="popular_illust_block__item"]|.//ul[@class="item_list"]/li[@class="list_item  middle"]/a|.//div/ul[@class="item_list"]/li[@class="list_item middle"]/a|.//p[@class="info_source"]/a[@class="user_name"]/../../..',
      detailTitleXP: '//ul/li[@class="user_name"]/strong|//span[@class="nickname"]',
      detailTitleSearchXP: '//ul/li[@class="user_name"]/strong[+++]/../../../../../../../../../../../..|//span[@class="nickname" and +++]/../../../../../../..',
    }, {
      id: 'KAKAKU',
      urlRE: '//kakaku.com/search_results/',
      listTitleXP: '//p[@class="p-item_name s-biggerlinkHover_underline"]',
      listTitleSearchXP: '//p[@class="p-item_name s-biggerlinkHover_underline"][+++]/../../../../..',
      listTitleMemoSearchXP: '//p[@class="p-item_name s-biggerlinkHover_underline"][+++]',
      listGen: 5,
    }, {
      id: 'KAKAKU',
      urlRE: '//kakaku.com/specsearch|//kakaku.com/item/',
      listTitleXP: '//td[@class="textL"]/strong/a[1]',
      listTitleSearchXP: '//td[@class="textL"]/strong/a[1 and +++]/../../..',
      listTitleMemoSearchXP: '//td[@class="textL"]/strong/a[1 and +++]|//div[@class="boxL"]/h2[@itemprop="name" and +++]/..',
      listGen: 4,
      detailURLRE: /\/\/kakaku.com\/item\//,
      detailTitleXP: '//div[@class="boxL"]/h2[@itemprop="name"]',
      detailTitleSearchXP: '//div[@class="boxL"]/h2[@itemprop="name" and +++]/../../../..',
    }, {
      id: 'HELLOWORK',
      urlRE: '//www.hellowork.mhlw.go.jp/kensaku/',
      listTitleXP: '//td[@class="fb in_width_9em" and text()="求人番号"]/following-sibling::td/div',
      listTitleSearchXP: '//td[@class="fb in_width_9em" and text()="求人番号"]/following-sibling::td/div[+++]/../../../../../../../../..|//div[@id="ID_kjNo"]',
      listTitleMemoSearchXP: '//td[@class="fb in_width_9em" and text()="求人番号"]/following-sibling::td/div[+++]/../../../..|//div[@id="ID_kjNo" and +++]/../../..',
      listHelpXP: '//td[@class="fb in_width_9em" and text()="求人番号"]/following-sibling::td/div/../../../../../../../../..',
      listGen: 8,
      detailURLRE: /Detail/i,
      detailTitleXP: '//div[@id="ID_kjNo"]',
      detailTitleSearchXP: '//div[@id="ID_kjNo" and +++]/../../../../..',
      func: () => { if (location.href.match(/detail/i)) { GM_addStyle('table.normal tr th, table.normal tr td { padding: 0.2em 1em;}') } else { GM_addStyle('table.kyujin th, table.kyujin td { padding: 0.5em 0.5em; } table.normal tr th, table.normal tr td { border-top: 1px solid #125939; padding: 0.5em 10px; text-align: left; } .mb03 { margin-bottom: 0em; }'); } },
    }, {
      id: 'USERBENCHMARK',
      urlRE: '.*?.userbenchmark.com',
      listTitleXP: '//span/a[@class="nodec"]',
      listTitleSearchXP: '//span/a[@class="nodec" and +++]/../../../../..',
      listTitleMemoSearchXP: '//span/a[@class="nodec" and +++]|//h1[@class="pg-head-title"]/a[+++]',
      listGen: 5,
      observe: 1000,
      detailURLRE: /\/\/.*?.userbenchmark.com\/SpeedTest\/|\/\/.*?.userbenchmark.com\/.*?\/Rating\//i,
      detailTitleXP: '//h1[@class="pg-head-title"]/a',
      detailTitleSearchXP: '//h1[@class="pg-head-title"]/a[+++]/../../..',
      automemoURLRE: /\/\/.*?.userbenchmark.com\/SpeedTest\/|\/\/.*?.userbenchmark.com\/.*?\/Rating\//i,
      automemoSearchFunc: () => { return eletext('//h3[@class="pg-head-toption"]/span[@class="pg-head-toption-post"]') + "\n"; },
      automemoFunc: () => { autoMemo(/(.*)/); },
    }, {
      urlRE: '//www.sukima.me/(?!bv|login)',
      id: 'SUKIMA',
      listTitleXP: '//div[@class="row ma-0 flex-nowrap align-center title-name-content"]/div',
      listTitleSearchXP: '//div[@class="row ma-0 flex-nowrap align-center title-name-content"]/div[***]/../../../..',
      listTitleMemoSearchXP: '//div[@class="row ma-0 flex-nowrap align-center title-name-content"]/div[***]',
      listHelpXP: '//div[@class="row ma-0 flex-nowrap align-center title-name-content"]/div/../../../..',
      listGen: 5,
      titleProcessFunc: title => { return title.replace(/\n\s*?\n\s*?|(?分冊版)?.*|【期間限定 無料お試し版】.*|[0-90-9]*?巻.*/g, "").trim() },
      observe: 1500,
      func: () => {
        /*        var observeUrlHasChangedhref = location.href;
                var observeUrlHasChanged = new MutationObserver(mutations => { if (observeUrlHasChangedhref !== location.href) location.reload() });
                observeUrlHasChanged.observe(document, { childList: true, subtree: true });
          */
        document.title = document.title.replace(/(^\[.*\])(.*)/, "$2$1");
      } // ページタイトルの「[全話無料]」等の接頭辞を末尾に移動
    },
    {
      urlRE: '//www.mangaz.com/',
      //      id: 'MANGAZ', // SUKIMAと登録内容を共通にしない
      id: 'SUKIMA', // SUKIMAと登録内容を共通にする
      listTitleXP: '//div[@class="listBoxDetail"]/h4/a',
      listTitleSearchXP: '//div[@class="listBoxDetail"]/h4/a[***]/../../../..',
      listTitleMemoSearchXP: '//div[@class="listBoxDetail"]/h4/a[***]|//div[@class="bookHeadContents"]/div[@class="bookHeadDetail"]/h1[***]/../..|//div[@id="seriesContents"]/div[@class="header"]/h2[***]',
      listGen: 7,
      listHelpXP: '//div[@class="listBox"]',
      titleProcessFunc: (title) => { return title.replace(/\s[0-90-9]+巻?$|【.*?】|全.*?巻|第\d*話/gmi, "").trim() },
      detailURLRE: "//www.mangaz.com/book/detail/|//www.mangaz.com/series/detail/",
      detailTitleXP: '//div[@class="bookHeadContents"]/div[@class="bookHeadDetail"]/h1|//div[@id="seriesContents"]/div[@class="header"]/h2',
      detailTitleSearchXP: '//div[@class="bookHeadContents"]/div[@class="bookHeadDetail"]/h1[***]/../../../..|//div[@id="seriesContents"]/div[@class="header"]/h2[***]/../..',
      observe: 500,
      func: () => { document.title = document.title.replace(/(^【.*】)(.*)/, "$2$1"); } // ページタイトルの「[全話無料]」等の接頭辞を末尾に移動
    }, {
      id: 'PICCOMA',
      urlRE: '//piccoma.com/',
      listTitleXP: '//div[@class="PCM-productCoverImage_title"]/span|.//div[@class="PCM-rankingProduct_title"]/p|.//p[@class="PCM-productCoverImage_title"]/span',
      listTitleSearchXP: '//div[@class="PCM-productCoverImage_title"]/span[+++]/ancestor::li[contains(@class,"PCM-slotProducts_list")]|.//div[@class="PCM-rankingProduct_tdata"]/div/p[+++]/ancestor::li[contains(@class,"PCM-slotProducts_list")]|.//p[@class="PCM-productCoverImage_title"]/span[+++]/ancestor::li[contains(@class,"PCM-slotProducts_list")]',
      listTitleMemoSearchXP: '//div[@class="PCM-productCoverImage_title"]/span[+++]', // 実質表示されない
      listGen: 7,
      //lastEpisode:'//button[@class="btn btn-default" and contains(text(),"移動する")]',
      /*
            urlRE: '//piccoma.com/web/waitfree_sale_list/',
            listTitleXP: '//p[@class="PCM-productCoverImage_title"]/span',
            listTitleSearchXP: '//p[@class="PCM-productCoverImage_title"]/span[+++]/../../../../..',
            listTitleMemoSearchXP: '//p[@class="PCM-productCoverImage_title"]/span[+++]',
            listGen: 5,
      */
      observe: 3000,
    }, {
      id: 'TAMESHIYOMI',
      urlRE: '//www.cmoa.jp/freecontents/',
      listTitleXP: '//p[@class="titile_name"]/a',
      listTitleSearchXP: '//p[@class="titile_name"]/a[+++]/../../../..',
      listTitleMemoSearchXP: '//p[@class="titile_name"]/a[+++]',
      listGen: 4,
      redoWhenReturned: 1,
    },
    // @match *://ja.aliexpress.com/*
    {
      id: 'ja.aliexpress.com',
      urlRE: '//ja.aliexpress.com/',
      listTitleXP: '//h1[@class="_3eC3x"]/../../..',
      listTitleXP2: '//a[@class="ox0KZ"]',
      listHelpXP: '//h1[@class="_3eC3x"]/../../..',
      XP2name: 'セラー名 ',
      XP2memo: 1,
      listTitleSearchXP: '//a[**url**]/*/*/h1[@class="_3eC3x"]/../../..|//a[@class="ox0KZ"][+++]/../../..',
      listTitleMemoSearchXP: '//a[**url**]/*/*/h1[@class="_3eC3x"]|//a[@class="ox0KZ"][+++]',
      listGen: 3,
      useURL: 1,
      func: () => { // 商品名を全行表示する
        elegeta('//div[@class="product-container"]/div[2]/a/div[2]/div[1]/h1').forEach(e => {
          e.style.whiteSpace = "";
          e.style.height = "auto";
          e.style.whiteSpace = "normal";
          e.parentNode.style.display = "block"
        });
      },
    },
    /*
           id: 'ALIEXPRESS',// 不動 仕様変更待ち
          urlRE: '//.*.aliexpress.com/af/|//.*.aliexpress.com/item/|//.*.aliexpress.com/wholesale',
          listTitleXP: '//a/div[last()]/div[1]/h1',
    //      listHelpXP: '//a/span',
          listTitleSearchXP: '//div[@class="product-container"]/div/a/div[last()]/div[1]/h1[***]/../../../..',
          listTitleMemoSearchXP: '//div[@class="product-container"]/div/a/div[last()]/div[1]/h1[***]/..',
          listGen: 9,
          detailURLRE: /.*.aliexpress.com\/item\//,
          detailTitleXP: '//h1[@class="product-title-text"]|.//div[@class="shop-name"]/a|.//h3[@class="store-name"]/a',
          detailTitleSearchXP: '//h1[@class="product-title-text" and ***]/../../../../..|.//div[@class="shop-name"]/a[+++]/../../../../../../..',
          detailRangeFunc: pointedDOM => { return pointedDOM.parentNode.parentNode; },
          observe: 500,
          func: () => { // 商品名を全行表示する
            elegeta('//a/span').forEach(e => { e.style.whiteSpace = ""; });
            elegeta('//a/span').forEach(e => {
              e.style.height = "auto";
              e.style.whiteSpace = "normal";
            })
          },
        }, {
    */
    {
      id: 'GREASYFORK',
      urlRE: '//greasyfork.org/.*?/scripts',
      listTitleXP: '//article/h2/a',
      listTitleSearchXP: '//article/h2/a[+++]/../../..|//article/h2/a/font/font[+++]/../../../../..',
      listTitleMemoSearchXP: '//article/h2/a[+++]|//article/h2/a/font/font[+++]/../..',
      listGen: 6,
      // func:(n)=>{elegeta('//h2/a[@class="script-link"]',n).forEach(e=>{$(e.parentNode.parentNode.parentNode).append(' <a style="float:right;margin:0 0 0 1em;" href="'+e.href+'/stats?period=all">統計</a>').append(' <a style="float:right;margin:0 0 0 1em;" href="'+e.href+'/feedback">フィードバック</a>')})  },
    }, {
      id: 'JMTY',
      urlRE: '//jmty.jp/',
      listTitleXP: '//div/h2[@class="p-item-title"]/a',
      listTitleSearchXP: '//div/h2[@class="p-item-title"]/a[++url++]/../../..',
      listTitleMemoSearchXP: '//div/h2[@class="p-item-title"]/a[++url++]',
      listGen: 5,
      useURL: 1,
    }, {
      id: 'EBAY',
      urlRE: 'ebay.com/',
      listTitleXP: '//a[@class="s-item__link"]/h3/..',
      listTitleSearchXP: '//a[@class="s-item__link"][**url**]/h3/../../../..|//div[@class="si-inner"]/div/div/div/a/span[@class="mbg-nw"][+++]',
      listTitleMemoSearchXP: '//a[@class="s-item__link"][**url**]/h3/../..|//h1[@itemprop="name" and @id="itemTitle"][**url**]/..|//div[@class="si-inner"]/div/div/div/a/span[@class="mbg-nw"][+++]/..',
      listTitleXP2: '//div[@class="si-inner"]/div/div/div/a/span[@class="mbg-nw"]',
      XP2memo: 1,
      XP2name: 'セラー名 ',
      listGen: 6,
      useURL: 1,
      funcOnlyFirst: () => {
        var e = eleget0('//link[@rel="canonical"]');
        var t = eleget0('//h1[@itemprop="name" and @id="itemTitle"]')
        if (e && t) t.setAttribute("href", e.href)
      },
      detailURLRE: /www.ebay.com\/itm\//,
      detailTitleXP: '//h1[@itemprop="name" and @id="itemTitle"]',
      detailTitleSearchXP: '//h1[@itemprop="name" and @id="itemTitle"][**url**]/../../../../../../../..|//div[@class="si-inner"]/div/div/div/a/span[@class="mbg-nw"][+++]/../../../../../../../..',
      //titleProcessFunc: title => { return title.replace(/^NEW LISTING|^Details about\s*/i, "") },

      //listTitleXP: '//h3[contains(@class,"s-item__title")]|//h1[@id="itemTitle"]',
      //  listTitleSearchXP: '//h3[contains(@class,"s-item__title") and ***]/../../../..',
      //  listTitleMemoSearchXP: '//h3[contains(@class,"s-item__title") and ***]|//h1[@id="itemTitle" and ***]/..',
      //  listGen: 6,

      //detailURLRE: /www.ebay.com\/itm\//,
      //detailTitleXP: '//h1[@id="itemTitle"]',
      //detailTitleSearchXP: '//h1[@id="itemTitle" and ***]/../../../..',
      //titleProcessFunc: title => { return title.replace(/^NEW LISTING|^Details about\s*/i, "") },
      listHelpJQS: 'li.s-item',
      helpInBlock: 1,
      maxpriceXP: '//div/input[@aria-label="Maximum Value"]',
    }, {

      id: '2CHTHREADLIST',
      urlRE: /\/\/.*\.5ch\.net\/\w*\/$/,
      listTitleXP: '//td/a',
      listTitleSearchXP: '//table[@id="thread-list"]/tbody/tr/td/a[+++]/../..',
      listTitleMemoSearchXP: '//tr/td/a[+++]',
      listTitleMemoSearchXPSameGen: 1,
      listGen: 6,
      delay: 1000,
      observe: 500, // 並べ替え時に必要
      redoWhenReturned: 1,
    }, {
      id: `${/shitaraba\.net/.test(location.href)?"SHITARABA":"5CH"}`, //'5CH',
      urlRE: '.5ch.net/test/read.cgi/|.shitaraba.net/bbs/read.cgi/',
      //      id: '5CH',
      //      urlRE: '.5ch.net/test/read.cgi/',
      listTitleXP: '//div[@class="meta"]', // 項目名はレス番~IDまでの一連のdiv.meta
      listTitleSearchXP: '//div[@class="meta"][++title++]/..|//span[@class="escaped"][***]/../..',
      listTitleMemoSearchXP: '//div[@class="meta"][++title++]/span[@class="date"]',
      //      listHelpXP: '//div/div[@class="post"]',
      listHelpXP: '//div[@class="post"]',
      listGen: 6,
      searchAllowLength: 1,
      delay: 100, //delayAutoWeighting: 0.6, // 5chサムネイル表示他のhNukiURLHokan()より後でないとメモを消せなくなる
      listTitleSearchFunc: (title) => { // レス中キーワードNG
        let resHit = [];
        if (typeof title === "string" && /\D/m.test(title)) { // textContentでサーチする
          for (let res of elegeta('//div[@class="message"]')) { // レス本文
            if (res.textContent.indexOf(title) !== -1) resHit.push(res.parentNode);
          }
          for (let res of elegeta('//span[@class="uid"]')) { // ID
            if (res.textContent.indexOf(title) !== -1) resHit.push(res.parentNode.parentNode);
          }
        }
        return resHit;
      },
      funcQ: function() {
        setTimeout(() => {
          $('div.post:hidden').next("br").css("display", "none");
          $('div.post:visible').next("br:hidden").css("display", "block");
        }, 200);
      }, //余計な改行を詰める
      funcB: () => SITE.funcQ(),
      funcOnlyFirst: () => {
        // 旧表示なら対応するために加工
        if (/\.5ch\.net\/test\/read\.cgi\/|\.shitaraba\.net\/bbs\/read\.cgi\//.test(location.href) && eleget0("//div/dl/dt")) {
          var res1 = elegeta("//div/dl/dt")
          var res2 = elegeta("//div/dl/dd")
          if (res1.length && res1.length == res2.length) {
            GM_addStyle('div.post{background-color:#efefef; display:inline-block; padding:0.5em 0.5em 0.5em; margin:0.25em 0.25em; box-shadow: 1px 1px 2px #cccccc;} div.meta{margin:0 0 0.33em;}') // line-height:1.2em;
            GM_addStyle('div.post2{background-color:#efefef; display:inline-block; padding:1em; margin:0; box-shadow: 1px 1px 2px #cccccc;} div.meta{margin:0 0 0.33em;}') // line-height:1.2em;
            var e = eleget0('//div/dl[@class="thread"]/../../../..|//div[@id="thread-body-wrapper"]/..');
            if (e) e.style.backgroundColor = "#f2f3f7";
            var e = eleget0('//body/div/span[@style="float:left;"]');
            if (e) e.style.float = "none";
            res1.forEach((e, i) => {
              var res1t = e.textContent; // innerTextは遅い
              var res2o = res2[i].outerHTML; //alert(res2o)
              while (/<br>[\s]{0,22}\<\/dd\>/.test(res2o)) res2o = res2o.replace(/<br>[\s]{0,22}\<\/dd\>/, "</dd>"); // 後ろの空改行をtrim
              e.outerHTML = `<div class="post"><div class="meta" title="${document.title+res1t}"><span style="display:none;" class="number">${res1t.match(/(\d+)/)[1]}</span><span class="date">${res1[i].innerHTML}</span></div><div class="message"><span class="escaped">${res2o.replace(/^<dd>/,"").replace(/<\/dd>/,"")}</span></div></div><br>`;
              res2[i].remove();
            });
          }

          // 旧5chに引用ポップアップ
          var re = [];
          //var res = [...elegeta('//div[@class="post"]')].map(e => e.outerHTML.replace(/class=\"post\"/, 'class=\"post2\"')); //res=res.forEach(e=>e.style.display="block")
          var res = [];
          elegeta('//span[@class="number"]').forEach(e => { res[e.textContent] = e.closest("div.post").outerHTML.replace(/class=\"post\"/, 'class=\"post2\"') }); //res=res.forEach(e=>e.style.display="block")
          elegeta('//div[@class="message"]/span/a[contains(text(),">>")]|//div[@class="message"]/span/span/a[contains(text(),">>")]').forEach((e, i) => {
            var r = e.innerText.match(/\>\>(\d+)/);
            if (r) {
              e.setAttribute("ankerno", r[1]);
              /* $(e).hover(()=>{ $("body").append($(`<span id="ftbpu" style="background-color:#Fefefe; border:1px solid #333; position:absolute; left:${$(e).offset().left + $(e).outerWidth()}px; top:${$(e).offset().top}px;">` + res[r[1]-1] + "</span>")) },()=>$("#ftbpu").remove()) */
            }
          });
          var latestHover;
          setInterval(() => {
            var h = $("a:hover,div:hover").get()
            var e = h.find(e => e.textContent.match(/^\>\>\d{1,4}$/));
            //var e = hovEle[0]
            if (e && latestHover != e && e.className != "post2") {
              $("body").append($(`<span class="ftbpu" style="background-color:#Fefefe; outline: 1px solid gray; outline-offset: -1px; position:absolute; left:${$(e).offset().left + $(e).outerWidth()}px; top:${$(e).offset().top}px;">` +
                (res[e.textContent.match(/^\>\>(\d{1,4})$/)[1]] || 'Undefined') + "</span>"))
              // $("body").append($(`<span class="ftbpu" style="background-color:#Fefefe; outline: 1px solid gray;position:absolute; left:${$(e).offset().left + $(e).outerWidth()+1}px; top:${$(e).offset().top}px;">` + eleget0(`//span[@class="number"][text()="${e.textContent.match(/^\>\>(\d{1,4})$/)[1]}"]/../..`).outerHTML+ "</span>"))
            }
            if (!e && $("span.ftbpu").length && (h.find(e => e.className == "post2") == undefined)) { $(".ftbpu").remove() }
            latestHover = e
          }, 17)

        }
      },

      func: () => {
        for (let e of elegeta('//div[@class="meta"][not(@title)]')) { // レスの特定のために1行目をまとめてtitle属性に埋める
          let id = e.innerText.replace(/>>.*/g, "");
          e.title = id; // e.style.pointerEvents="none";
        };
        SITE.funcQ();
        $('body').on('mouseup', function(e) {
          var selectedStr;
          if (window.getSelection) {
            selectedStr = window.getSelection().toString();
            if (selectedStr !== '' && selectedStr !== '\n') {
              if (selectedStr.indexOf("\n") !== -1) popup2("複数行に渡る文字列は NG に入れられません", 1);
              else popup2(KEYHIDE + ' キー:<br>『' + selectedStr + '』<br>をNGワードに追加', 1);
            }
          }
        });
      },
      hideSelectedWord: 1,
      memoStyle: ' float:right; ',
    }, {
      id: 'NICODOUGA',
      urlRE: '//www.nicovideo.jp/ranking',
      listTitleXP: '//div/h2[@class="MediaObjectTitle VideoMediaObject-title MediaObjectTitle_fixed2Line"]',
      listTitleSearchXP: '//div/h2[@class="MediaObjectTitle VideoMediaObject-title MediaObjectTitle_fixed2Line"][+++]/../../../../..',
      listTitleMemoSearchXP: '//div/h2[@class="MediaObjectTitle VideoMediaObject-title MediaObjectTitle_fixed2Line"][+++]',
      listGen: 6,
    }, {
      id: 'NICODOUGA',
      urlRE: '//www.nicovideo.jp/series/',
      listTitleXP: '//div[@class="VideoMediaObject-title"]/a',
      listTitleSearchXP: '//div[@class="VideoMediaObject-title"]/a[+++]/../../../..',
      listTitleMemoSearchXP: '//div[@class="VideoMediaObject-title"]/a[+++]',
      listGen: 5,
      listTitleHelpXP: '//div[@class="VideoMediaObject-title"]/a/../../../..',
    }, {
      id: 'NICODOUGA', // nicosea::
      urlRE: '//www.nicovideo.jp/search/|//www.nicovideo.jp/tag/',
      listTitleXP: '//div/p[@class="itemTitle"]/a',
      listTitleSearchXP: '//div/p[@class="itemTitle"]/a[++title++]/../../..',
      listTitleMemoSearchXP: '//div/p[@class="itemTitle"]/a[++title++]',
      listGen: 7,
      //      func: function(node) { for (let ele of elegeta('//div/p[@class="itemTitle"]/a', node)) ele.textContent = ele.title; }, // 長いタイトルが...で省略されているとヒットしないのでtitleプロパティから取り出す
      //    }, {
      //      id: 'NICODOUGA', // URLをキーにする
      //      urlRE: '//www.nicovideo.jp/user/.*/video',
      //      listTitleXP: '//a[@class="VideoMediaObject-linkArea"]',
      //      listTitleSearchXP: '//a[@class="VideoMediaObject-linkArea"][++url++]/..',
      //      listTitleMemoSearchXP: '//a[@class="VideoMediaObject-linkArea"][++url++]/div[2]/span',
      //      listGen: 6,
      //      useURL: 1,
      //      observe: 500,
      //      //func: function(node) { for (let ele of elegeta('//div/p[@class="itemTitle"]/a', node)) ele.textContent = ele.title; }, // 長いタイトルが...で省略されているとヒットしないのでtitleプロパティから取り出す
    }, {
      id: 'NICODOUGA', // タイトルをキーにする
      urlRE: '//www.nicovideo.jp/user/.*/video',
      listTitleXP: '//div[@class="NC-MediaObject-bodyTitle"]/h2',
      listTitleSearchXP: '//div[@class="NC-MediaObject-bodyTitle"]/h2[+++]/../../../../..',
      listTitleMemoSearchXP: '//div[@class="NC-MediaObject-bodyTitle"]/h2[+++]',
      listGen: 5,
      observe: 500,
      //                    {
      //      id: 'NICODOUGA', // タイトルをキーにする
      //      urlRE: '//www.nicovideo.jp/user/.*/video',
      //      listTitleXP: '//div[@class="VideoMediaObject-body"]/span',
      //      listTitleSearchXP: '//div[@class="VideoMediaObject-body"]/span[+++]/../../../..',
      //      listTitleMemoSearchXP: '//div[@class="VideoMediaObject-body"]/span[+++]',
      //      listGen: 5,
      //      observe: 500,
      //      func: function(node) { for (let ele of elegeta('//div/p[@class="itemTitle"]/a', node)) ele.textContent = ele.title; }, // 長いタイトルが...で省略されているとヒットしないのでtitleプロパティから取り出す
      // }, {
      //       id: 'NICODOUGA', // 旧(-2020年07月26日)
      //       urlRE: '//www.nicovideo.jp/user/.*/video',
      //       listTitleXP: '//div[@class="section VideoItem-videoDetail"]/h5/a',
      //       listTitleSearchXP: '//div[@class="section VideoItem-videoDetail"]/h5/a[+++]/../../..',
      //       listTitleMemoSearchXP: '//div[@class="section VideoItem-videoDetail"]/h5/a[+++]',
      //       listGen: 5,
      //       //      func: function(node) { for (let ele of elegeta('//div/p[@class="itemTitle"]/a', node)) ele.textContent = ele.title; }, // 長いタイトルが...で省略されているとヒットしないのでtitleプロパティから取り出す
    }, {
      id: 'NICODOUGA', // タイトルをキーにする
      urlRE: '//www.nicovideo.jp/user/.*?/mylist/', // バグらなくなった
      listTitleXP: '//div[@class="NC-MediaObject-bodyTitle"]/h2',
      listTitleSearchXP: '//div[@class="NC-MediaObject-bodyTitle"]/h2[+++]/../../../../..',
      listTitleMemoSearchXP: '//div[@class="NC-MediaObject-bodyTitle"]/h2[+++]',
      listGen: 6,
      observe: 500,
      listTitleXPIgnoreNotExist: 1,
      //    reloadWhenUrlHasChanged:1,
    }, {
      id: 'NICODOUGA',
      urlRE: '//www.nicovideo.jp/my/mylist|www.nicovideo.jp/my/watchlater',
      listTitleXP: '//h2[@class="NC-MediaObjectTitle NC-VideoMediaObject-title NC-MediaObjectTitle_fixed2Line"]',
      listTitleSearchXP: '//h2[@class="NC-MediaObjectTitle NC-VideoMediaObject-title NC-MediaObjectTitle_fixed2Line"][+++]/../../../../../..',
      listTitleMemoSearchXP: '//h2[@class="NC-MediaObjectTitle NC-VideoMediaObject-title NC-MediaObjectTitle_fixed2Line"][+++]',
      delay: 2000,
      listGen: 5,
      listTitleXPIgnoreNotExist: 1,
      //    reloadWhenUrlHasChanged:1,
    }, {
      id: 'RTINGS',
      urlRE: 'www.rtings.com/.*?/tools/table|//www.rtings.com/.*?/reviews/',
      listTitleXP: '//div/div[@class="table_cell_product-name"]',
      listTitleSearchXP: '//div/div[@class="table_cell_product-name"][***]/../../../../..',
      listTitleMemoSearchXP: '//div/div[@class="table_cell_product-name"][***]/..|//span[@class="e-page_title-primary"][***]',
      listGen: 3,
      listTitleXPIgnoreNotExist: 1,
      delay: 3000,
      observe: 1000,
      detailURLRE: /\/\/www.rtings.com\/.*?\/reviews\//,
      detailTitleXP: '//span[@class="e-page_title-primary"]',
      detailTitleSearchXP: '//span[@class="e-page_title-primary"][***]/../../../../..',
    }, {
      id: 'TAMESHIYOMI',
      urlRE: 'csbs.shogakukan.co.jp',
      listTitleXP: '//div[1]/img[@class="is-item-cover loaded"]',
      listTitleSearchXP: '//div[1]/img[@class="is-item-cover loaded" and ++alt++]/../../..',
      listTitleMemoSearchXP: '//div[1]/img[@class="is-item-cover loaded" and ++alt++]',
      listGen: 3,
      listTitleXPIgnoreNotExist: 1,
      delay: 1000,
      observe: 1500,
      redoWhenReturned: 1,
    }, {
      id: 'TAMESHIYOMI',
      urlRE: '//sokuyomi.jp/free_',
      listTitleXP: '//p[@class="title"]/a|//h1[@class="title"]',
      listTitleSearchXP: '//p[@class="title"]/a[++title++]/../..',
      listTitleMemoSearchXP: '//p[@class="title"]/a[++title++]', // 多分表示されない
      listGen: 3,
      observe: 900,
      listHelpXP: '//div[@id="content"]/div/ul/li',
      redoWhenReturned: 1,
    }, {
      id: 'TAMESHIYOMI',
      urlRE: '//sokuyomi.jp/free\.',
      listTitleXP: '//img[@class="waku"]',
      listTitleSearchXP: '//img[@class="waku" and ++alt++]/../..',
      listTitleMemoSearchXP: '//img[@class="waku" and ++alt++]',
      listHelpXP: '//div[@id="content"]/div/ul/li',
      listGen: 3,
      observe: 600,
      redoWhenReturned: 1,
    }, {
      urlRE: '//ebookjapan.yahoo.co.jp/viewer',
      func: () => {
        //$().ready(() => { setTimeout(() => { document.title = (eleget0('//div[@class="header__title"]').innerText || "") + " " + document.title; }, 2000); });
      },
    }, {
      id: 'TAMESHIYOMI',
      urlRE: '//ebookjapan.yahoo.co.jp/free|//ebookjapan.yahoo.co.jp/ranking/details/free/',
      listTitleXP: '//div[2]/p[@class="book-caption__title"]|.//p[@class="book-item__title"]',
      listTitleSearchXP: '//div[2]/p[@class="book-caption__title" and ***]/../../..|.//p[@class="book-item__title"][***]/../../../..',
      listTitleMemoSearchXP: '//div[2]/p[@class="book-caption__title" and ***]|.//p[@class="book-item__title"][***]',

      listGen: 3,
      titleProcessFunc: (title) => { return title.replace(/\s[0-90-9]+巻?$/gmi, "").replace(/[(\(][0-90-9]+巻?[)\)]$/gmi, "").replace(/【期間限定.*?】|【フルカラー】/g, "").replace(/\s\d+冊/gmi, "").trim() },
      observe: 1000,
      redoWhenReturned: 1,
    }, {
      id: 'TAMESHIYOMI',
      urlRE: 'booklive.jp/index/no-charge',
      listTitleXP: '//p[@class="p-no-charge-book-item__title"]/a',
      listTitleSearchXP: '//p[@class="p-no-charge-book-item__title"]/a[***]/../../..',
      listTitleMemoSearchXP: '//p[@class="p-no-charge-book-item__title"]/a[***]',
      listGen: 5,
      titleProcessFunc: (title) => { return title.replace(/\s[0-90-9]+巻?$/gmi, "").replace(/[(\(][0-90-9]+巻?[)\)]/gmi, "").replace(/【.*?】|(.*?)|分冊版[\s::]*|合冊版[\s::]*/g, "").replace(/第?[0-90-9]+話?$/gmi, "").trim() },
      listTitleXPIgnoreNotExist: 1,
      observe: 1000,
      redoWhenReturned: 1,
    }, {
      id: 'WCA',
      urlRE: 'webcomics\.jp',
      //      listTitleXP: '//div[@class="entry-title"]/a[1]|//div[@class="comic-title"]/h2/a[1]',
      //      listTitleSearchXP: '//div[@class="entry-title"]/a[+++]/../..|//div[@class="comic-title"]/h2/a[1][+++]/../../../../../..', // 完全一致のキーワードのみヒット+漫画サイト名にはヒットしない(高速)
      //      listTitleMemoSearchXP: '//div[@class="entry-title"]/a[+++]|//div[@class="comic-title"]/h2/a[1][+++]/..',
      listTitleXP2: '//div[@class="entry-site"]/a[1]', // サイト名でQ/1/2可…重いので
      XP2name: 'サイト名 ',
      XP2memo: 1,
      listTitleXP: '//div[@class="entry-title"]/a[1]|//div[@class="comic-title"]/h2/a[1]',
      listTitleSearchXP: '//div[@class="entry-title"]/a[+++]/../..|//div[@class="comic-title"]/h2/a[1][+++]/../../../../../..|.//div[@class="entry-site"]/a[1][+++]/../..', // 完全一致のキーワードのみヒット+サイト名にヒット(低速)
      listTitleMemoSearchXP: '//div[@class="entry-title"]/a[+++]|//div[@class="comic-title"]/h2/a[1][+++]/..|.//div[@class="entry-site"]/a[1][+++]',
      listGen: 5,
      listHelpJQS: 'div.entry',
      helpInBlock: 1,
      redoWhenReturned: 1,
      func: function(node) { // width 880-600→1180-900
        if (node === document.body && document.documentElement.clientWidth > 1200 && ($("#page").css("width")) == "880px") {
          $("#main-container").css("width", "900px");
          $("#page").css("width", "1180px");
        }
        //        if (WCA_HIDE_SOME_SITES) { for (let ele of elegeta(SITES_TO_BE_HIDDEN_XP, node)) hideByTitle(ele) }
        if (WCA_HIDE_SOME_SITES) { for (let name of SITES_TO_BE_HIDDEN) { hideByTitle(name, document, '//div[@class="entry-site"]/a[+++]/../..') } }
        if (eleget0('//div[@class="comic-author"]') && /^https:\/\/webcomics\.jp\/[^/]+\/[^/]+$/.test(location.href)) autoMemo(/作者: (.*)/m) //autoMemo(/作者: (.*)/m,'//div[@class="comic-author"]',)
      },
      //funcOnTOn: () => { if (WCA_HIDE_SOME_SITES) { for (let ele of elegeta(SITES_TO_BE_HIDDEN_XP)) showByTitle(ele, 0) } },
      funcOnTOn: () => { for (let name of SITES_TO_BE_HIDDEN) { showByTitle(name, 0, '//div[@class="entry-site"]/a[+++]/../..') } },
      autoTranslucentURLRE: /mylist|bookmark|https:\/\/webcomics\.jp\/[^\/]+\/\d+$/,

      //ditailURLRE:/^https:\/\/webcomics\.jp\/[^\/]+\/\d+\/$/, // 詳細画面と判定するのが難しい
      //detailTitleXP: '//div[@class="comic-title"]/h2/a[1][+++]',
      //detailTitleSearchXP: '//div[@class="comic-title"]/h2/a[1][+++]/../../..',

      automemoURLRE: /https:\/\/webcomics\.jp\/[^/]+\/\d+$/,
      automemoSearchFunc: () => { return eletext('//div[@class="comic-author"]'); },
    }, {
      id: 'YAJ2',
      urlRE: '://auctions.yahoo.co.jp/search/|://page.auctions.yahoo.co.jp/jp/auction/|://auctions.yahoo.co.jp/category/list/',
      listTitleXP: '//div[@class="Product__infoTable"]/div/h3[@class="Product__title"]/a',
      listTitleSearchXP: '//div[@class="Product__infoTable"]/div/h3[@class="Product__title"]/a[***]/../../../../..|.//div[@class="Product__sellerArea"]/a[+++]/../../../../..|//span[@class="Seller__name"]/a[1][+++]',
      listTitleMemoSearchXP: '//div[@class="Product__infoTable"]/div/h3[@class="Product__title"]/a[***]|//h1[@class="ProductTitle__text" and ***]|.//div[@class="Product__sellerArea"]/a[+++]|.//span[@class="Seller__name"]/a[1][+++]',
      listTitleXP2: '//div[@class="Product__sellerArea"]/a|//span[@class="Seller__name"]/a[1]',
      XP2name: '出品者名 ',
      XP2memo: 1,
      listGen: 6,
      listHelpXP: '//li[@class="Product"]',
      helpInBlock: 1,
      wholeHelp: " " + KEYMAXP + ":価格上限",
      detailURLRE: /:\/\/page.auctions.yahoo.co.jp\/jp\/auction\//,
      detailTitleXP: '//h1[@class="ProductTitle__text"]',
      detailTitleSearchXP: '//h1[@class="ProductTitle__text" and ***]/../../../..|//span[@class="Seller__name"]/a[+++]/../../../../../../../../../../..|.//span[@class="Seller__name"]/a[1][+++]',
      maxpriceXP: '//input[@class="InputText__input" and @name="max"]',
      automemoURLRE: "://page.auctions.yahoo.co.jp/jp/auction/",
      automemoSearchFunc: () => { return eletext('//div[@class="ProductExplanation__commentArea"]') + "\n" + eletext('//div[@id="ProductProcedures"]') + "\n" + eletext('//h1[@class="ProductTitle__text"]') + '\n' + eletext('//ul[@class="ProductInformation__items"]/li[2]') + '\n' + eletext('//div/div[@class="ProductDetail"]'); },
      automemoFunc: () => {
        for (let am of CUSTOMAUTOMEMORE) { autoMemo(am); }
        autoMemo(/(レターパック[^0-90-9\n]*[0-9,0-9,]*円[-~]?)/m);
        autoMemo(/(クリックポスト[^0-90-9\n]*[0-9,0-9,]*円[-~]?)/m);
        autoMemo(/(ゆうメール[^0-90-9\n]*[0-9,0-9,]*円[-~]?)/m);
        autoMemo(/(ゆうパケット[^0-90-9\n]*[0-9,0-9,]*円[-~]?)/m);
        autoMemo(/(ゆうパック[^0-90-9\n]*[0-9,0-9,]*円[-~]?)/m);
        autoMemo(/(定形外[^0-90-9\n]*[0-9,0-9,]*円[-~]?)/m);
        autoMemo(/(メール便[^0-90-9\n]*[0-9,0-9,]*円[-~]?)/m);
        autoMemo(/送料.*(全国一律\s*[0-9,0-9,]*.*円[-~]?)/m);
        autoMemo(/送料\s*[::]?(.*[都道府県]は[0-9,0-9,]*円[-~]?)/m);
        autoMemo(/(Pentium.*?GHz)|(Celeron.*?GHz)|(Atom.*?GHz)|(Core\s?i\d.*?GHz)|(AMD.*APU)/mi) ? 0 :
          autoMemo(/(CPU[\s\S]{1,30}?GHz)/mi) ? 0 :
          autoMemo(/^(.*GHz)/gmi) ? 0 :
          autoMemo(/(Pentium[0-9A-Za-z\-_.]*\W*[0-9A-Za-z\-_.]*[0-9A-Za-z\-_.]*\W*[0-9A-Za-z\-_.]*)|(Celeron[0-9A-Za-z\-_.]*\W*[0-9A-Za-z\-_.]*)|(Atom\s[0-9A-Za-z\-_.]*\W*[0-9A-Za-z\-_.]*)|(Core\s?i\d.[0-9A-Za-z\-_.]*)|(Ryzen\s?\d[0-9A-Za-z\-_.]*\W*[0-9A-Za-z\-_.]*)/mi);
        autoMemo(/([0-90-9]{2,4}年製)/m) ? 0 :
          autoMemo(/([0-90-9]{2,4}年)/m) ? 0 :
          autoMemo(/([0-90-9]{2,4}年製)/m) ? 0 :
          autoMemo(/([0-90-9]{2,4}年)/m);
        autoMemo(/発送元:(.{1,4}[都道府県])/m);
        autoMemo(/(認証制限[\s\S]{1,3}あり)/m);
      },
      showFunc: () => { run(document.body, "returned") },
    }, {
      id: 'YAJ2',
      urlRE: '://auctions.yahoo.co.jp/seller/',
      listTitleXP: '//a[@class="Product__titleLink"]|.//a[@class="Product__titleLink u-textBold"]|.//div[@class="a1wrp"]/h3/a',
      listTitleXP2: '//div/div[@class="seller__subInfo"]/span[@class="seller__yid"]',
      XP2name: '出品者名 ',
      XP2memo: 1,
      listGen: 4,
      listHelpJQS: "div.a1,#list01 table tbody tr td",
      listTitleSearchXP: '//div[@class="a1wrp"]/h3/a[***]/../../../..|.//div[@class="a1wrp"]/h3/a/em[***]/../../../../..|//div/div[@class="seller__subInfo"]/span[@class="seller__yid"][+++]',
      listTitleMemoSearchXP: '//div[@class="a1wrp"]/h3/a[***]|.//div[@class="a1wrp"]/h3/a/em[***]/..|//div/div[@class="seller__subInfo"]/span[@class="seller__yid"][+++]',
      redoWhenReturned: 1,
    }, {
      id: 'YAJ2',
      urlRE: 'userbenchmark',
    }, {
      id: 'AMAZON',
      urlRE: /www\.amazon\.co\.jp\/s\?k\=|www\.amazon\.co\.jp.*\/dp\/.*/,
      //listTitleXP: '//span[@class="a-size-base-plus a-color-base a-text-normal"]|//span[@id="productTitle"]|//h1[@id="title"]/span[@id="productTitle"]',
      //listTitleXP: '//div[@class="a-section a-spacing-none"]/div[1]/h2/a[@class="a-link-normal a-text-normal"]/span|//span[@id="productTitle"]|//h1[@id="title"]/span[@id="productTitle"]',
      listTitleXP: '//span[@class="a-size-base-plus a-color-base a-text-normal"]|//h1[@id="title"]/span[@id="productTitle"]',
      //      listTitleSearchXP: '//span[@class="a-size-base-plus a-color-base a-text-normal" and ***]/ancestor::div[contains(@class,"sg-col-4-of-12 s-result-item")]|.//a[@class="a-link-normal"]/div[@data-rows="4" and ***]/../../..|.//a[@class="a-link-normal"]/div[@data-rows="4"][***]', // ancestor
      //listTitleSearchXP: '//span[@class="a-size-base-plus a-color-base a-text-normal" and ***]/ancestor::div[contains(@class,"s-result-item s-asin")]|.//a[@class="a-link-normal"]/div[@data-rows="4" and ***]/../../..|.//a[@class="a-link-normal"]/div[@data-rows="4"][***]', // ancestor
      //      listTitleMemoSearchXP: '//span[@class="a-size-base-plus a-color-base a-text-normal" and ***]/..|//span[@id="productTitle" and ***]/..|.//a[@class="a-link-normal"]/div[@data-rows="4"][***]|//div[@class="p13n-sc-truncate-desktop-type2  p13n-sc-truncated"][***]',
      //listTitleSearchXP: '//div[@class="a-section a-spacing-none"]/div[1]/h2/a[@class="a-link-normal a-text-normal"]/span[***]/ancestor::div[contains(@class,"s-result-item s-asin")]|.//a[@class="a-link-normal"]/div[@data-rows="4" and ***]/../../..|.//a[@class="a-link-normal"]/div[@data-rows="4"][***]', // ancestor
      //      listTitleMemoSearchXP: '//div[@class="a-section a-spacing-none"]/div[1]/h2/a[@class="a-link-normal a-text-normal"]/span[***]/..|//span[@id="productTitle" and ***]/..|.//a[@class="a-link-normal"]/div[@data-rows="4"][***]|//div[@class="p13n-sc-truncate-desktop-type2  p13n-sc-truncated"][***]',
      listTitleSearchXP: '//span[@class="a-size-base-plus a-color-base a-text-normal"][***]/ancestor::div[contains(@class,"s-result-item s-asin")]|.//a[@class="a-link-normal"]/div[@data-rows="4" and ***]/../../..|.//a[@class="a-link-normal"]/div[@data-rows="4"][***]', // ancestor
      listTitleMemoSearchXP: '//span[@class="a-size-base-plus a-color-base a-text-normal"][***]/..|//span[@id="productTitle" and ***]/..|.//a[@class="a-link-normal"]/div[@data-rows="4"][***]|//div[@class="p13n-sc-truncate-desktop-type2  p13n-sc-truncated"][***]',
      detailTitleSearchXP: '//span[@id="productTitle" and ***]/../../../../../..|//h1/a[@class="a-link-normal" and ***]/../../../../../../../../../../../../..|//div[@class="p13n-sc-truncate-desktop-type2  p13n-sc-truncated"][***]/../../../../..',
      listGen: 12,
      listHelpXP: '//span[@class="a-size-base-plus a-color-base a-text-normal"]/../../../..|//span[@id="productTitle"]/../../../..',
      trim: true,
      func: () => {
        elegeta('//*[@class="s-line-clamp-2"]|.//*[@class="s-line-clamp-3"]').forEach(e => e.style.maxHeight = "auto");
        elegeta('//div[@class="a-section a-spacing-none"]/div[1]/h2/a[@class="a-link-normal a-text-normal"]/span').forEach(e => e.style.display = "inline-block") // 商品名を広く表示する
      },
      //observe: 200,
      observeClassName: ["a-declarative", "nav-span", "autopagerize-icon", "vsc-controller", "DAsis"],
      observeTagName: "DIV",
      //      listHelpJQS: 'div[data-asin]',
      detailURLRE: /\/dp\/|\/product-reviews\//,
      detailTitleXP: '//h1[@id="title"]/span[@id="productTitle"]',
      hideListEvenDetail: 1,

      automemoURLRE: /https:\/\/www.amazon.co.jp.*\/dp\//,
      automemoSearchFunc: () => { return eletext(['//div[@id="ppd"]/div[4]', '//div/div[@data-template-name="productDescription" and @id="productDescription_feature_div"]', '//div[@data-template-name="productDescription"]', '//div[@id="important-information"]', '//div[@id="prodDetails"]']); },
      automemoFunc: () => {
        if (eleget0('//div[@id="nav-subnav" and @data-category="beauty"]|//div[@id="nav-subnav" and @data-category="hpc"]|//div[@id="nav-subnav" and @class="spacious subnav-untied"]')) {
          [/(イソプロピルメチルフェノール)/m, /(IPMP)/m, /(塩化セチルピリジニウム|塩化セシルピリジニウム|セチルピリジニウム塩化物)/m, /(CPC)/m, /(塩化ベンザルコニウム)/m, /(BKC)/m, /(ラウロイルサルコシンナトリウム|ラウロイルサルコシンNa|ラウロイルサルコシンNa)/m, /(LSS)/m, /(塩化ベンゼトニウム)/m, /(BTC)/m, /(クロルヘキシジン)/m, /(CHG)/m, /(グリチルリチン酸アンモニウム)/m, /(イプシロン.アミノカプロン酸)/m, /(ε.ACA)/m, /(トラネキサム酸)/m, /(TXA)/m, /(グリチルリチン酸ジカリウム|グリチルリチン酸二カリウム|グリチルリチン酸2K|グリチルリチン酸2K|GK2)/mi, /(1\,?450\s?ppm)/m, /(高?濃?度?フッ化ナトリウム|高?濃?度?フッ素)/m, /(ハイドロオ?キシアパタイト)/m, /(リン酸化オリゴ糖カルシウム)/m, /(POs-Ca|POs-Ca)/mi, /(カゼインホスホペプチド.非結晶性リン酸カルシウム|リカルデント)/m, /(CPP-ACP)/m, /(チモール)/m, /(サリチル酸メ?チ?ル?)/m, /(1\,8-シネオール)/m, /(トリクロサン)/m, /(トリクロカルバン)/m, /(オクトピロックス|ピロクトン.?オラミン)/m, /(Znピリチオン|ジンクピリチオン)/m, /(硫黄|イオウ)/m, /(アラントイン)/m, /(グリチルリチン酸アンモニウム)/m, /(ミコナゾール硝?酸?塩?)/m, /(クロラムフェニコール)/m, /(フラジオマイシン硫?酸?塩?)/m, /(ナイスタチン)/m, /(塩化亜鉛)/m, /(ポビドン.?ヨード)/m, /(ラウリルジアミノエチルグリシンナトリウム)/m, /(カキタンニン)/m, /(チャエキス)/m, /(ローズマリー)/m, /(カンゾウ)/m, /(クマザサ)/m, /(セージ)/m, /(シソエキス)/m, /(β?-?グリチルレチン酸?)/m, /(メントール)/m, /(ポリリン酸ナトリウム|ポリリン酸Na)/m, /(ヒノキチオール)/m, /(ティーツリー油オ?イ?ル?)/m, /(ティートゥリー油オ?イ?ル?)/m].forEach(m => autoMemo(m));
        }
        if (eleget0('//div/div[@id="nav-subnav" and @data-category="electronics"]')) {
          [/([\d\s\,]+mAh)/m, /([\d\s\,]+mAh)/m, /([\d\s\,]{2,9}回)/m].forEach(m => autoMemo(m));
        }
        if (eleget0('//div[@id="nav-subnav" and @data-category="kitchen"]|//div[@id="nav-subnav" and @data-category="home"]')) {
          [/([0-90-9++]+?物質)/m, /([0-90-9++]+?項目)/m, /(交換.{1,19}[0-9.]+ヶ月)|(交換.{1,19}[0-9.]+年)|(取替.{1,19}[0-9.]+ヶ月)|(取替.{1,19}[0-9.]+年)/m].forEach(m => autoMemo(m));
        }
      },
      funcOnlyFirst: () => {
        var observeUrlHasChangedhref = location.href;
        var observeUrlHasChanged = new MutationObserver(mutations => {
          if (observeUrlHasChangedhref !== location.href) {
            observeUrlHasChangedhref = location.href;
            elegeta('//span[contains(@class,"yhmMyMemo")]').forEach(e => e.parentNode.remove());
            setTimeout(() => { run(document.body, "returned") }, 2500);
          }
        });
        observeUrlHasChanged.observe(document, { childList: true, subtree: true });
      },
    },
    /*    {
          id: '', // GM_setValueで保存するグループ名 同じグループは設定が共通になる
          urlRE: '', // 動作するサイトのURLの一部(正規表現)
          necessaryToWork: /$^/, // これがあるとdocument.bodyにこれにmatchする文字列がなければ動作を停止する urlREだけでは非対応ページを絞り込めない時に使用
          listTitleXP: '', // 項目一覧ページの項目名を特定できる要素のXPath title>text>altの順にあるものから利用される
          listTitleXP2: '', // 項目一覧ページの項目名の第2候補を指すXPath これにホバーしていればQキーでこれのinnerTextでもNG登録できる
          XP2name: '', // XP2にホバーした時のガイドに表示する文字列
          XP2memo: 0, // 1だとXP2でも1-6キーのメモを許可
          listTitleSearchXP: '', // 項目一覧ページの項目を消すブロック要素をサーチするXPath 通常listTitleXPにサーチ用マクロを付け/..をいくつかつけたもの
          listTitleSearchFunc: null, // 項目一覧ページの項目を消すブロック要素をサーチする関数 5chのレス本文キーワードNGなどで使用
          listTitleMemoSearchXP: '', // 項目一覧ページと詳細ページのメモを付ける要素をサーチするXPath(一覧と詳細の両方を|でOR記述) 通常listTitleXPやdetailTitleXPにサーチ用マクロを付け/..をいくつかつけたもの
          listTitleMemoSearchXPSameGen: 0, // 1だとメモをタイトルと同じ世代の要素として付ける 0だと1つ親世代
            // サーチ用マクロ; ***:textをcontainsで検索 +++:textを=で検索 ++alt++:altを=で検索 ++title++:titleを=で検索 **url**:hrefをcontainsで検索(要useURL) ++url++:hrefを=で検索(要useURL)
          listGen: 3, // Q12を押した場所の要素からいくつ上まで遡った要素までを当たり判定にするか 必要最小限にする
          listHelpJQS: '', // 項目一覧ページで操作ガイドを表示する要素のJQueryセレクタ ↓でも良い 両方を省略するとlistTitleXPの2つ親の要素で代用 当たり判定とは関係ない
          listHelpXP: '', // 項目一覧ページで操作ガイドを表示する要素のXpath ↑でも良い 両方を省略するとlistTitleXPの2つ親の要素で代用 当たり判定とは関係ない
          helpInBlock: 0, // 1だと操作ガイドを要素のブロック内に表示する
          detailURLRE: //, // URLにmatchする正規表現、matchすると個別詳細画面だと判断する
          detailTitleXP: '', // 詳細画面で項目名を指すXPath
          detailTitleSearchXP: '', // 詳細画面で非表示化時に表示を薄くする要素をサーチするXPath
          func: null, // 処理時にそのサイトでのみ実行したい関数があれば書く
          titleProcessFunc: null, // 項目名を保存する前に加工したければ関数を書く
          autoTranslucentURLRE: //, // 強制的に半透明モードにするURLの正規表現 Web漫画アンテナのマイリスト等
          listTitleXPIgnoreNotExist: 0, // 通常listTitleXPにヒットする要素が1つもなくobserveも0なら動作を停止するがこれがtrueだとそれを無視する 項目が動的に追加されるページなどで使用
          delay: 0, // ミリ秒 ページ読み込み後処理を開始するまでの遅延
          delayAutoWeighting: 0, // 0以外ならページ開始時から処理開始までの遅延の係数(省略可) delayと排他利用
          observe: 0, // ミリ秒 1以上だと要素追加ごとにこのミリ秒の遅延を置いて再処理する(とても遅い) 項目が動的に追加されるページなどで使用
          observeId: "", // これがあるとobserve有効時にこのIDの要素でないものは無視する YouTubeなどの高速化に重要
          observeClassName:[], // これがあるとobserve有効時にこのclassNameの要素は処理しない
          observeTagName:"", // これがあるとobserve有効時にこのtagNameの要素は処理しない
          trim: 0, // 1だと項目名をtrimしてから保存 Amazonでは項目名が一覧と詳細で揺れるため1にする
          automemoURLRE: null, // 自動メモを収集するURL
          automemoSearchFunc: null, // 自動メモの対象要素のテキストを収集する関数
          automemoFunc: null, // 自動メモを実行する関数
          redoWhenReturned: 0, // これが1かdetailTitleXPが存在すれば他タブから戻ってきた時に全体を再処理する
          showFunc: null, // QWで項目を再表示した時に実行したい関数があれば書く
          hideListEvenDetail: 0, // 1なら詳細画面でも一覧画面用の非表示を実行する ニコニコ静画(イラスト)などで使用
          detailRangeFunc: null, // 詳細画面で項目対象が2つ以上ある場合に指した要素から遡る等の処理があれば書く関数
          //useURL: 0, // 1なら項目名としてAタグのhrefを取り込み、使う ジモティ等、完全に同名の項目名が付けられやすいサイトで使用
          useURL: 0, // 1なら項目名としてAタグのhrefを取り込み、使う(?以降は無視) ジモティ等、完全に同名の項目名が付けられやすいサイトで使用
          useText: 0, // 1なら項目名としてtextContentを取り込み、使う Pubmed等IDではない@titleが設定されているためテキストを優先したいサイトで使用
          hideSelectedWord: 1, // 1ならQキーを押した時に文字列選択中ならその文字列を非表示リストに入れる 5chのレス本文キーワードNGなどで使用
          disableHelpForce: 0, // 1ならENABLE_HELP_CONCLUSIONを常に0にしヘルプやガイドを一切表示しない
          disableKeyB: 0, // 1ならBキーは効かなくする youtubeなどで使用
          searchAllowLength: 0, // 1ならQ12キーの当たり判定をゆるくする(説明しづらい) 5chで使用
          reloadWhenUrlHasChanged:0, // 1ならURLが変わった時にリロードする SPAサイトなどで使用
          helpOnDNI: 0, // 1ならdniでの継ぎ足し時非表示にしたレポートを逐一表示する
          disableUrlRE: "", // URLにマッチしたらキー操作を無効にする正規表現 YouTubeなどSPAサイトで動画視聴ページでキー操作の機能を無効にするために使用
          urlHasChangedCommonFunc: null, // urlが変わったら実行する関数 uniqlo等シングルページアプリケーションで一覧と詳細を行き来するサイト等で使用
          WhateverFirstAndEveryAPFunc: null, // 対象要素がなくてもurlREにマッチしたページならとにかく最初とAutoPagerize時に実行する関数
        },
    */
  ];

  var siteinfo = Object.assign(SITEINFO, pref("MY_SITEINFO") || []); //alert(siteinfo);return;
  // thissiteを決定
  var thissite = null;
  for (var i = 0; i < siteinfo.length; i++) {
    if (siteinfo[i].urlRE == "") break;
    if (location.href.match(siteinfo[i].urlRE)) {
      thissite = i;
      var SITE = Object.create(siteinfo[thissite]);
      if ((SITE.detailTitleSearchXP || "").indexOf("***") == -1 && (SITE.listTitleSearchXP || "").indexOf("***") == -1 && (SITE.listTitleMemoSearchXP || "").indexOf("***") == -1) SITE.disableKeyB = 1;
      break;
    }
  }
  if (thissite === null || (!ENABLE_EXCEPT_YAJ && SITE.id != "YAJ2")) return;

  let ENABLE_HELP_CONCLUSION = SITE.disableHelpForce ? 0 : ENABLE_HELP;

  //  GM_addStyle("span.yhmMyMemo{word-wrap:break-word;cursor:pointer; font-size:90%; font-weight:bold; margin:0px 1px; text-align:center; padding:0px 6px 0px 6px; border-radius:12px; color:white;font-family:sans-serif;word-warp:}")
  GM_addStyle("span.yhmMyMemo{all:initial; word-wrap:break-word;cursor:pointer; font-size:90%; font-weight:bold; margin:0px 1px; text-align:center; padding:0px 6px 0px 6px; border-radius:12px; color:white;font-family:sans-serif;}")
  const MEMOSTYLE = SITE.memoStyle ? SITE.memoStyle : "";
  const CUSTOMAUTOMEMORE = [/(Windows.*bit)/gmi, /((?:HDD|HDD|SSD|SSD|ハードディスク|ストレージ).*?(?:GB|TB|GB|TB|無し|なし|無|欠品|欠))/mi, /((?:10|テン)(?:key|キー))/mi, /(768.{1,3}576)|(800.{1,3}600)|(832.{1,3}624)|(1024.{1,3}768)|(1152.{1,3}864)|(1,?280.{1,3}960)|(1400.{1,3}1050)|(1440.{1,3}1080)|(1600.{1,3}1200)|(2048.{1,3}1536)|(2304.{1,3}1728)|(3200.{1,3}2400)|(854.{1,3}480)|(1024.{1,3}576)|(1136.{1,3}640)|(1280.{1,3}720)|(1,?36\d?.{1,3}768)|(1,?920.{1,3}1,?080)|(2048.{1,3}1152)|(2,?560.{1,3}1,?440)|(3200.{1,3}1800)|(3,?840.{1,3}2,?160)|(7680.{1,3}4320)|(640.{1,3}400)|(1280.{1,3}800)|(1,?440.{1,3}900)|(1680.{1,3}1050)|(1,?920.{1,3}1,?200)|(2560.{1,3}1600)|(2880.{1,3}1800)|(3840.{1,3}2400)|(480.{1,3}320)|(960.{1,3}640)|(176.{1,3}144)|(400.{1,3}240)|(352.{1,3}288)|(640.{1,3}350)|(720.{1,3}480)|(800.{1,3}480)|(864.{1,3}480)|(1024.{1,3}480)|(1024.{1,3}600)|(1280.{1,3}600)|(1120.{1,3}750)|(1280.{1,3}768)|(1152.{1,3}870)|(1280.{1,3}1024)|(1,?600.{1,3}900)|(1,?600.{1,3}1024)|(2048.{1,3}1080)|(4096.{1,3}2160)|(8192.{1,3}4320)/m, /(非光沢|ノングレア|ノーグレア|アンチグレア|光沢|グレア)/m, /((?:30|40)\s?(?:pin|ピン))/mi, /(LVDS.*$|eDP)/mi, /^(.*リカバリ.*)$/mi, /(仕事率[^0-90-9\n]*[0-9,0-9,]*\s*[wW])/mi, /(\[?\s?関東[^0-9,0-9,\n]*[0-9,0-9,]*\s*円[-~]?)/m, /(\[?\s?本州[^0-9,0-9,\n]*[0-9,0-9,]*\s*円[-~]?)/m, /(HDMI.{0,10}入力.{2,3}|入力.{0,20}HDMI.{2,3})/mi, /(電源入り.{2,10})/mi, /(\d\d鍵)/m];
  //const CUSTOMAUTOMEMORE = [/$()^/]; // 無指定
  // ,/(フルHD|Full\s?HD|FHD|WXGA|FWXGA|QVGA|WXGA\+|SXGA|SXGA\+|HD\+|WXGA\+\+|WSXGA|WSXGA\+|UXGA|FHD|2K|WUXGA|FHD\+|UltraWideFHD|QXGA|WQHD|WQXGA|UltraWideQHD\+|QUXGA|QFHD|UHD4K|DCI4K|8KFUHD)/m
  const alsoClearBenchMemoWhenClearAutoMemo = 0; // 1:Shift+"で自動メモのみ削除する時CPUスコアのメモも削除する 0:CPUスコアのメモは残す

  const LogMatch = 0;

  sw("start")
  var mousex = 0;
  var mousey = 0;
  var maey = 0;

  // userbenchmarkでの動作
  if (location.href.match(/cpu.userbenchmark.com\/.*\/Rating\/|cpu.userbenchmark.com\/SpeedTest\//i)) { //userbenchmark
    setTimeout(() => {
      let cpuscore = $(eleget0('//td[@class="mcs-hl-col" and contains(text(),"64-Core")]/span')).css("border", "4px dotted blue").text();
      let cpuscore1t = "1C:" + $(eleget0('//td[@class="mcs-hl-col" and contains(text(),"1-Core")]/span')).css("border", "4px dotted blue").text();
      cpuscore = cpuscore.replace(/(.*\%).*/, "$1").trim();
      let ubmodel = eleget0('//h1[@class="pg-head-title"]/a[@class="stealthlink"]').innerText.trim();
      let lasttitle = pref("lastItemName") || "";
      let modelno = (ubmodel.replace(/^core i\d-?(\S?\s?\d{3,5}.*$)/gi, "$1").replace(/^Core2 Duo (.?\d{3,5}.*$)/gi, "$1").trim());
      for (let title of (lasttitle ? lasttitle.indexOf(modelno) != -1 ? [modelno] : [lasttitle, modelno] : [modelno])) {
        for (let memo of [
            (document.body.innerText.match(/TDP\s*\d* W/m) || [""])[0],
            cpuscore, cpuscore1t,
          ]) {
          var tmp = pref('YAJ2 : SearchMyMemo') || [];
          var isExist = tmp.filter(e => e.t == title && e.m == memo);
          popup3(title + "<br>" + memo, 0, 2);
          if (isExist.length == 0) {
            if (title && memo) {
              let tmp = pref('YAJ2 : SearchMyMemo') || [];
              tmp.push({ t: title, m: memo, c: COLORCPUSCORE })
              pref('YAJ2 : SearchMyMemo', tmp)
            }
          }
        }
      }
      pref("lastItemName", "");
      //popup3("Task completed");
    }, 500);
    //return;
  }
  if (location.href.indexOf("userbenchmark.com") != -1) {} else {
    pref("lastItemName") ? (pref("lastItemName", ""), popup3("UBM Task has been cleared")) : 0;
  }

  // GM_設定を前バージョンから引き継ぐ
  if (pref(SITE.id + 'SearchHideTitle') && !pref(SITE.id + ' : SearchHideTitle')) {
    pref(SITE.id + ' : SearchHideTitle', pref(SITE.id + 'SearchHideTitle'));
    pref(SITE.id + 'SearchHideTitle', "");
  }
  if (pref(SITE.id + 'SearchMyMemo') && !pref(SITE.id + ' : SearchMyMemo')) {
    pref(SITE.id + ' : SearchMyMemo', pref(SITE.id + 'SearchMyMemo'));
    pref(SITE.id + 'SearchMyMemo', "");
  }
  if (pref(SITE.id + 'SearchHideTitle') && pref(SITE.id + ' : SearchHideTitle')) {
    pref(SITE.id + 'SearchHideTitle', "");
  }
  if (pref(SITE.id + 'SearchMyMemo') && pref(SITE.id + ' : SearchMyMemo')) {
    pref(SITE.id + 'SearchMyMemo', "");
  }

  if (SITE.funcOnlyFirst) SITE.funcOnlyFirst();
  if (SITE.WhateverFirstAndEveryAPFunc) {
    SITE.WhateverFirstAndEveryAPFunc();
    document.body.addEventListener('AutoPagerize_DOMNodeInserted', function(evt) { SITE.WhateverFirstAndEveryAPFunc(evt.target); }, false);
  }

  if (SITE.reloadWhenUrlHasChanged) {
    var observeUrlHasChangedhref = location.href;
    var observeUrlHasChanged = new MutationObserver(mutations => { if (observeUrlHasChangedhref !== location.href) location.reload() });
    observeUrlHasChanged.observe(document, { childList: true, subtree: true });
  }

  // 詳細画面?
  var isDetail = (SITE.detailURLRE && location.href.match(SITE.detailURLRE)) ? 1 : 0;
  dc("isDetail : " + isDetail)

  // ヤフオク上限価格はIME offにする
  if (SITE.id == "YAJ2") $(eleget0('//input[@class="InputText__input" and @name="max"]')).css('ime-mode', 'inactive');
  // ヤフオクは「画像を大きく」モードでは効かない
  if (SITE.id == "YAJ2" && !isDetail && eleget0('//span[@class="Option__mode Option__mode--gridCurrent"]')) {
    popup2("「ヤフオクで非表示とメモ」は「タイトルと画像」表示でのみ働きます");
    return;
  }
  // 自動的に半透明モードにするページ
  var disableHide = (SITE.autoTranslucentURLRE && location.href.match(SITE.autoTranslucentURLRE)) || (pref("translucent") == "on");

  // 非対応ページ
  if (!isDetail && SITE.listTitleXP && !eleget0(SITE.listTitleXP)) {
    if (!(SITE.listTitleXPIgnoreNotExist) && !(SITE.observe)) {
      if (debug2) popup3("対象要素がないのでこのページでは働きません");
      return;
    }
  }

  if (SITE.necessaryToWork && (document.body.innerText.match(SITE.necessaryToWork)) == null) { //prompt(document.body.innerText,document.body.innerText.match(SITE.necessaryToWork))
    if (debug2) popup3("非対応ページなのでこのページでは働きません");
    return;
  }

  String.prototype.replaceTitle = function(title) {
    if (title && SITE.titleProcessFunc) title = SITE.titleProcessFunc(title);
    if (!title) title = "空の文字列";
    //return this.replace(/\*\*\*/g, "contains(text(),\"" + title + "\")").replace(/\+\+\+/g, "text()=\"" + title + "\"").replace(/\*\*alt\*\*/g, "@alt=\"" + title + "\"").replace(/\+\+title\+\+/g, "@title=\"" + title + "\"").replace(/\+\+url\+\+/g, "@href=\"" + title + "\"");
    //    return this.replace(/\*\*\*/g, "contains(text(),\"" + title + "\")").replace(/\+\+\+/g, "text()=\"" + title + "\"").replace(/\*\*alt\*\*/g, "@alt=\"" + title + "\"").replace(/\+\+title\+\+/g, "@title=\"" + title + "\"").replace(/\+\+url\+\+/g, "@href=\"" + title + "\"");
    //    return this.replace(/\*\*\*/g, "contains(text(),\"" + title + "\")").replace(/\+\+\+/g, "text()=\"" + title + "\"").replace(/\*\*alt\*\*/g, "@alt=\"" + title + "\"").replace(/\+\+title\+\+/g, "@title=\"" + title + "\"").replace(/\+\+url\+\+/g, "@href=\"" + title + "\"").replace(/\*\*url\*\*/g, "contains(@href,\"" + title + "\")");
    return this.replace(/\*\*\*/g, "contains(text(),\"" + title + "\")").replace(/\+\+\+/g, "text()=\"" + title + "\"").replace(/\+\+alt\+\+/g, "@alt=\"" + title + "\"").replace(/\+\+title\+\+/g, "@title=\"" + title + "\"").replace(/\+\+url\+\+/g, "@href=\"" + title + "\"").replace(/\*\*url\*\*/g, "contains(@href,\"" + title + "\")");
  };

  //  var keyListen=document.addEventListener('keydown', function(e) {
  var keyListen = function(e) {
    if (SITE.disableUrlRE && (location.href.match(SITE.disableUrlRE))) { return; }
    if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA' && e.target.getAttribute('contenteditable') != 'true') {
      //    if (/input|textarea/i.test(e.target.tagName) == false) {
      var key = (e.shiftKey ? "Shift+" : "") + (e.altKey ? "Alt+" : "") + (e.ctrlKey ? "Ctrl+" : "") + e.key;
      if (key === KEYCHANGE_DEBUG) { // D::change debug mode
        debug = (debug + 1) % 4;
        popup3("debug mode : " + debug)
      }
      if (key === KEYHIDE) { // Q::hide
        e.preventDefault();
        if (SITE.hideSelectedWord) { // 選択された文字列をNG / 5ch等
          let sel = String(window.getSelection());
          if (sel) {
            if (sel.indexOf("\n") !== -1) { popup2("複数行の選択は NG に入れられません", 1); } else { addNG(sel); }
            if (SITE.funcB) SITE.funcB();
            return false;
          }
        }
        //        var ele = (SITE.detailTitleXP && isDetail) ? eleget0(SITE.detailTitleXP) : document.elementFromPoint(mousex, mousey);
        //        var ele = (SITE.detailTitleXP && isDetail) ? (eleget0(SITE.detailTitleXP, document.elementFromPoint(mousex, mousey)) || eleget0(SITE.detailTitleXP)) : document.elementFromPoint(mousex, mousey);
        if (SITE.listTitleXP2) { // 2つ目の項目名がありそこにホバーしていればそれで非表示登録
          var ele = document.elementFromPoint(mousex, mousey);
          if (elegeta(SITE.listTitleXP2).indexOf(ele) != -1) {
            hideByTitle(ele.innerText, SITE.listTitleXP2);
            addNG(ele.innerText);
            return false;
          }
        }
        var ele = (SITE.detailTitleXP && isDetail) ? (eleget0(SITE.detailTitleXP, (SITE.detailRangeFunc ? SITE.detailRangeFunc(document.elementFromPoint(mousex, mousey)) : document.elementFromPoint(mousex, mousey))) || eleget0(SITE.detailTitleXP)) : document.elementFromPoint(mousex, mousey);
        dc("Q start element : " + ele.tagName);
        blockElement(ele);
        if (SITE.funcQ) SITE.funcQ();
        return false;
      }
      if (key == KEYUNDO) { // W::undo
        e.preventDefault();
        let resist = pref(SITE.id + ' : SearchHideTitle') || [];
        let title = resist.pop();
        let title2 = resist.slice(-1)[0] || "";
        if (title2) title2 = "。次のアンドゥ対象は<br>『" + title2 + "』";
        pref(SITE.id + ' : SearchHideTitle', resist) || [];
        showByTitle(title);
        if (isDetail && SITE.showFunc) SITE.showFunc();
        if (title) popup2("『" + title + "』<br>を非表示登録から削除しました" + title2, 1);
        else popup2("登録された非表示項目はありません", 1);
        //        }
        if (SITE.funcQ) SITE.funcQ();
        return false;
      }
      if (key == KEYBW && !SITE.disableKeyB) { // B::NGword
        e.preventDefault();
        addNGWord();
        if (SITE.funcB) SITE.funcB();
        return false;
      }
      if (key == KEYTOGGLEtranslucent) { // T:: 半透明
        e.preventDefault();
        if (pref("translucent") == "on") restoreHidden();
        pref("translucent", pref("translucent") == "on" ? "off" : "on");;
        popup2(KEYTOGGLEtranslucent + ": 半透明モードを" + pref("translucent") + "にします");
        disableHide = (SITE.autoTranslucentURLRE && location.href.match(SITE.autoTranslucentURLRE)) || (pref("translucent") == "on");
        if (pref("translucent") == "on") {
          restoreTranslucent();
          run(document.body, "returned");
        }
        // location.reload();
        //        else restoreHidden();
        return false;
      }

      if (key === KEYEDIT) { // shift+Q:: edit NGs
        e.preventDefault();
        prefRestrict(SITE.id + ' : SearchHideTitle', "array");
        let sht = (JSON.stringify(pref(SITE.id + ' : SearchHideTitle') || ""));
        if (sht === '""') sht = "";
        let tmp = prompt(SITE.id + "\n\n" + KEYEDIT + ":\n非表示にするタイトル(現在" + (pref(SITE.id + ' : SearchHideTitle') || []).length + ")をJSON形式で編集してください\n正規表現ではありません\n空欄を入力すれば全削除できます\n\n" + sht, sht);
        if (tmp !== null) { // ESCで抜けたのでなければ
          pref(SITE.id + ' : SearchHideTitle', tmp.trim() || "")
          prefRestrict(SITE.id + ' : SearchHideTitle', "array");
          var a = pref(SITE.id + ' : SearchHideTitle')
          var b = [...new Set(a)]; // uniq
          pref(SITE.id + ' : SearchHideTitle', b || []);
          document.body.remove();
          location.reload();
        }
        return false;
      }
      if (key == KEYMEMO5 || key == KEYMEMO6) { // 5::5memo 6::6memo
        e.preventDefault();
        if (SITE.listTitleXP2 && SITE.XP2memo) { // 2つ目の項目名がありそこにホバーしていればそれで56
          var ele = document.elementFromPoint(mousex, mousey);
          if (elegeta(SITE.listTitleXP2).indexOf(ele) != -1) {
            var date = new Date();
            var dateStr = (key == KEYMEMO5 ? MEMO5WORD : MEMO6WORD) || date.getFullYear() + "." + ("0" + (date.getMonth() + 1)).slice(-2) + "." + ("0" + date.getDate()).slice(-2) + " (" + ["日", "月", "火", "水", "木", "金", "土"][date.getDay()] + ")";
            memoElement(ele.innerText, document, key == KEYMEMO5 ? COLOR5 : COLOR6, window.getSelection().toString().trim() || dateStr);
            return false;
          }
        }
        var ele = (SITE.detailTitleXP && isDetail) ? (eleget0(SITE.detailTitleXP, (SITE.detailRangeFunc ? SITE.detailRangeFunc(document.elementFromPoint(mousex, mousey)) : document.elementFromPoint(mousex, mousey))) || eleget0(SITE.detailTitleXP)) : document.elementFromPoint(mousex, mousey);
        var date = new Date();
        //var dateStr = (key=="5"?MEMO5WORD:MEMO6WORD)+date.getFullYear() + "年" + ("0" + (date.getMonth() + 1)).slice(-2) + "月" + ("0" + date.getDate()).slice(-2) + "日 (" + ["日", "月", "火", "水", "木", "金", "土"][date.getDay()] + ")";
        var dateStr = (key == KEYMEMO5 ? MEMO5WORD : MEMO6WORD) || date.getFullYear() + "." + ("0" + (date.getMonth() + 1)).slice(-2) + "." + ("0" + date.getDate()).slice(-2) + " (" + ["日", "月", "火", "水", "木", "金", "土"][date.getDay()] + ")";
        memoElement(ele, document, key == KEYMEMO5 ? COLOR5 : COLOR6, window.getSelection().toString().trim() || dateStr);
        return false;
      }
      if (key == KEYMEMO5EDIT || key == KEYMEMO6EDIT) { // Shift+5::5memo設定 Shift+6::6memo設定
        e.preventDefault();
        var date = new Date();
        var memo = window.getSelection().toString().trim() || prompt((key == KEYMEMO5EDIT ? KEYMEMO5 : KEYMEMO6) + "キーのメモ内容を設定してください", (key == KEYMEMO5EDIT ? MEMO5WORD : MEMO6WORD) || date.getFullYear() + "." + ("0" + (date.getMonth() + 1)).slice(-2) + "." + ("0" + date.getDate()).slice(-2) + " (" + ["日", "月", "火", "水", "木", "金", "土"][date.getDay()] + ")")
        if (key == KEYMEMO5EDIT) { MEMO5WORD = memo; } else { MEMO6WORD = memo; }
        return false;
      }
      if (key == KEYMEMO1 || key == KEYMEMO2) { // 1::1memo 2::2memo
        e.preventDefault();
        if (SITE.listTitleXP2 && SITE.XP2memo) { // 2つ目の項目名がありそこにホバーしていればそれで12
          var ele = document.elementFromPoint(mousex, mousey);
          if (elegeta(SITE.listTitleXP2).indexOf(ele) != -1) {
            memoElement(ele.innerText, document, key == KEYMEMO2 ? COLOR2 : COLOR1);
            return false;
          }
        }
        //        var ele = eleget0(SITE.detailTitleXP) ? eleget0(SITE.detailTitleXP) : document.elementFromPoint(mousex, mousey);
        var ele = (SITE.detailTitleXP && isDetail) ? (eleget0(SITE.detailTitleXP, (SITE.detailRangeFunc ? SITE.detailRangeFunc(document.elementFromPoint(mousex, mousey)) : document.elementFromPoint(mousex, mousey))) || eleget0(SITE.detailTitleXP)) : document.elementFromPoint(mousex, mousey);
        memoElement(ele, document, key == KEYMEMO2 ? COLOR2 : COLOR1);
        return false;
      }
      /*      if (key == KEYMEMO2) { // 2memo
              e.preventDefault();
              //        var ele = eleget0(SITE.detailTitleXP) ? eleget0(SITE.detailTitleXP) : document.elementFromPoint(mousex, mousey);
              var ele = (SITE.detailTitleXP && isDetail) ? (eleget0(SITE.detailTitleXP, (SITE.detailRangeFunc ? SITE.detailRangeFunc(document.elementFromPoint(mousex, mousey)) : document.elementFromPoint(mousex, mousey))) || eleget0(SITE.detailTitleXP)) : document.elementFromPoint(mousex, mousey);
              memoElement(ele, document, COLOR2);
              return false;
            }
            */
      if ((key == KEYMEMO1S || key == KEYMEMO2S)) { // 34 free memo
        e.preventDefault();
        var target = (prompt("メモを付けたい項目のタイトルが含むキーワードを入力してください") || "").trim();
        if (!target) return;
        var memo = (prompt("『" + target + "』\nに付けるメモを書いてください") || "").trim();
        if (!memo) return;
        storeMemo(target.trim(), memo, key == KEYMEMO1S ? COLOR1 : COLOR2)
        return false;
      }
      if (key == KEYRESETMEMO) { // !::reset memo
        e.preventDefault();
        prefRestrict(SITE.id + 'SearchMyMemo', "array");
        let smm = JSON.stringify(pref(SITE.id + ' : SearchMyMemo') || []);
        if (smm === '[]') smm = "";
        let tmp = prompt(SITE.id + "\n\n" + KEYRESETMEMO + ":\nメモ(現在" + (pref(SITE.id + ' : SearchMyMemo') || []).length + ")をJSON形式で編集してください\n空欄を入力すれば全削除されます\n\n" + smm, smm);
        if (tmp !== null) { // ESCで抜けたのでなければ
          pref(SITE.id + ' : SearchMyMemo', tmp.trim() || []);
          prefRestrict(SITE.id + 'SearchMyMemo', "array");
          var a = pref(SITE.id + ' : SearchMyMemo')
          var b = a.reduce((a, v) => { if (!a.some((e) => (e.t === v.t && e.m === v.m && e.c === v.c))) { a.push(v); } return a; }, []); // uniq
          pref(SITE.id + ' : SearchMyMemo', b || []);
          document.body.remove();
          location.reload();
        }
        return false;
      }
      if (key == KEYRESETMEMOAUTO) { // reset automemo
        e.preventDefault();
        var str = pref(SITE.id + ' : SearchMyMemo') || [];
        if (alsoClearBenchMemoWhenClearAutoMemo) {
          var newstr = str.filter(e => !(e.c == COLOR3 || e.c == COLORCPUSCORE)); // CPUスコアもリセット
          var newstr2 = str.filter(e => (e.c == COLOR3 || e.c == COLORCPUSCORE)); // CPUスコアもリセット
        } else {
          var newstr = str.filter(e => !(e.c == COLOR3));
          var newstr2 = str.filter(e => (e.c == COLOR3));
        }
        if (confirm(SITE.id + "\n\n" + KEYRESETMEMOAUTO + ":\n自動メモ(" + newstr2.length + ")のみ全て削除します。良いですか?\n\n消すもの:\n" + JSON.stringify(newstr2))) {
          pref(SITE.id + ' : SearchMyMemo', JSON.stringify(newstr));
          popup2("自動メモをクリアしました", 1);
          document.body.remove();
          location.reload();
        }
        return false;
      }
      if (key == "Shift+#") { // Shift+#::hide/show memo
        e.preventDefault();
        //        if (elegeta(`//span[contains(@class,"yhmMyMemo")][contains(@style,"display: none")]|//input[contains(@class,"ignoreMe shibo")][contains(@style,"display: none")]|//span[@id="shiboButton"][contains(@style,"display: none")]|//*[@id="5chVerticalThreadTitle"][contains(@style,"display: none")]`).length) {
        if (elegeta(`//span[contains(@class,"yhmMyMemo")]|//input[contains(@class,"ignoreMe shibo")]|//span[@id="shiboButton"]|//*[@id="5chVerticalThreadTitle"]`).filter(e => e.style.display == "none").length) {
          elegeta(`//span[contains(@class,"yhmMyMemo")]|//input[contains(@class,"ignoreMe shibo")]|//span[@id="shiboButton"]|//*[@id="5chVerticalThreadTitle"]`).forEach(e => e.style.display = "inline")
        } else {
          elegeta(`//span[contains(@class,"yhmMyMemo")]|//input[contains(@class,"ignoreMe shibo")]|//span[@id="shiboButton"]|//*[@id="5chVerticalThreadTitle"]`).forEach(e => e.style.display = "none")
        }
        return false;
      }
      if (SITE.maxpriceXP && !isDetail) {
        if (key == KEYMAXP) { // maxpriceXP
          e.preventDefault();
          let ele = eleget0(SITE.maxpriceXP);
          if (ele) {
            ele.focus();
            ele.scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
            ele.select();
            popup2("上限価格にフォーカス", 1);
          }
        }
        return false;
      }

    }
  }
  document.addEventListener('keydown', keyListen, false)

  document.addEventListener("mousemove", function(e) {
    mousex = e.clientX;
    mousey = e.clientY;
  }, false);

  // AP継ぎ足しを監視
  setTimeout(() => { run() }, (SITE.delayAutoWeighting || 0) * WAIT || (SITE.delay || 0));
  document.body.addEventListener('AutoPagerize_DOMNodeInserted', function(evt) { run(evt.target, "APed"); }, false);

  // DOM追加を監視
  var DNIDelay = null;
  //  if (!isDetail && SITE.observe) {
  if (SITE.observe) {
    dc("observe DNI");
    document.body.addEventListener('DOMNodeInserted', dnifunc, false);
    //document.body.addEventListener('transitionend', dnifunc, false); // テスト

    function dnifunc(e) {
      let ele = e.target;
      if (DNIDelay) return;
      //      if (SITE.disableUrlRE && (SITE.disableUrlRE.test(location.href))) { return; }
      if (SITE.observeId && (ele.id !== SITE.observeId)) return;
      //if( SITE.observeClass && e.target.className !== SITE.observeClass) return;
      //      if (ele.className === "ignoreMe phov" || ele.id === "yhmbox" || ele.className === "hzP") return;
      if (ele.classList && ele.classList.contains("ignoreMe")) return;
      if (SITE.observeTagName && SITE.observeTagName !== ele.tagName) return;
      //      if(ele.className && ["a-declarative","nav-span","autopagerize-icon","vsc-controller","DAsis"].includes(ele.className))return;
      if (ele.className && SITE.observeClassName && SITE.observeClassName.includes(ele.className)) return;
      DNIDelay = setTimeout(
        //        ((ele)=>{return ()=>{
        (function(ele) {
          return function() {
            run(document.body, "observed", ele); // ここで run(ele.parentNode.parentNode, "observed"); などとすると速くなるが~searchXPが何世代まで親を参照するか分からないので全サイトの動作確認が必要
            DNIDelay = null;
          }
        })(ele)
        //        () => {
        //        run(document.body, "observed",ele); // ここで run(ele.parentNode.parentNode, "observed"); などとすると速くなるが~searchXPが何世代まで親を参照するか分からないので全サイトの動作確認が必要
        //        DNIDelay = null;
        //      }
        , SITE.observe || 0);

    }
  }

  // 詳細画面に対応しているサイトかredoWhenReturnedが1ならタブにフォーカスが戻ったら再実行する
  if (SITE.detailTitleXP || SITE.redoWhenReturned) {
    var hidden, visibilityChange;
    if (typeof document.hidden !== "undefined") {
      hidden = "hidden";
      visibilityChange = "visibilitychange";
    } else if (typeof document.msHidden !== "undefined") {
      hidden = "msHidden";
      visibilityChange = "msvisibilitychange";
    } else if (typeof document.webkitHidden !== "undefined") {
      hidden = "webkitHidden";
      visibilityChange = "webkitvisibilitychange";
    }
    document.addEventListener(visibilityChange, handleVisibilityChange, false);

    function handleVisibilityChange() {
      if (SITE.disableUrlRE && (location.href.match(SITE.disableUrlRE))) { return; }
      if (document[hidden]) {} else {
        let prefHide = (SITE.autoTranslucentURLRE && location.href.match(SITE.autoTranslucentURLRE)) || (pref("translucent") == "on");
        if (prefHide !== disableHide) {
          disableHide = (SITE.autoTranslucentURLRE && location.href.match(SITE.autoTranslucentURLRE)) || (pref("translucent") == "on");
          restoreTranslucent();
        }
        restoreHidden();
      }
    }
  }

  // タブにフォーカスが戻った時等用 隠していた要素のうち非表示登録から外されたものを再表示
  function restoreHidden() {
    if (isDetail) {
      //      showByTitle(eleget0(SITE.detailTitleXP).textContent.replaceTitle());
      //      var dtitle = eleget0(SITE.detailTitleXP).textContent.replaceTitle();
      var d = eleget0(SITE.detailTitleXP)
      if (d && !(/\"/.test(d.textContent.replaceTitle()))) showByTitle(d.textContent.replaceTitle());
    }
    if (!isDetail || SITE.hideListEvenDetail) {
      let resist = pref(SITE.id + ' : SearchHideTitle') || [];
      sw("")
      for (let ele of elegeta('//*[@data-hidden="1" or @data-hidden="2"]')) {
        //let title = getTitleFromParent(ele, 1); // これだとXP2はヒットしないので再表示されない:保留
        let title = ele.dataset.yhmkey;
        if (SITE.titleProcessFunc) title = SITE.titleProcessFunc(title);
        let i = resist.indexOf(title); // ここは常に全体一致判定なのでcontains判定のサイトでは少し余計に再表示してしまう(でもまたすぐ隠す)
        if (i === -1) {
          showByTitle(title);
          //dc(title + "は再表示")
        }
      }
      sw("show by returned")

    }
    setTimeout(() => { run(document.body, "returned"); }, 0);
    if (SITE.funcQ) SITE.funcQ();
  }

  // ヤフオク キーワードの検索対象を切り替えるボタン
  if (SITE.id == "YAJ2") {
    if (location.href.indexOf("://page.auctions.yahoo.co.jp/jp/auction/") == -1) {
      for (let kw of [{ t: "タイトルからのみ検索する", s: "&f=0x2" }, { t: "タイトルと商品説明から検索する", s: "&f=0x4" }]) {
        var ele = eleget0('//div[@class="ptsOption"]/a/../../..');
        if (ele && !(location.href.match(kw.s))) {
          var ele2 = ele.parentNode.insertBefore(document.createElement("a"), ele.nextSibling);
          ele2.innerHTML = kw.t + " ";
          ele2.href = location.href.replace(/\&f\=.*(\&|$)/, "") + kw.s;
        }
      }
    }
  }

  // URL変化を監視、変化したら再実行
  if (SITE.urlHasChangedCommonFunc && !observeUrlHasChangedCommon) {
    var observeUrlHasChangedhrefCommon = location.href;
    var observeUrlHasChangedCommon = new MutationObserver(function(mutations) {
      if (observeUrlHasChangedhrefCommon !== location.href) {
        observeUrlHasChangedhrefCommon = location.href;
        SITE.urlHasChangedCommonFunc();
      }
    });
    observeUrlHasChangedCommon.observe(document, { childList: true, subtree: true });
  }

  function run(node = document.body, runmode = "1st", ele = null) { // 1st observed returned
    //    dc("runmode : " + runmode + " / node tag: " + node?.tagName + " / ele.tag : " + ele?.tagName + " / ele.class : " + ele?.className + " ele.id : " + ele?.id); // beautify
    dc("runmode : " + runmode + " / node tag: " + (node.tagName ? node.tagName : "-") + (ele ? (" / ele.tag : " + (ele.tagName ? ele.tagName : "-") + " | ele.class : " + (ele.className ? ele.className : "-") + " | ele.id : " + (ele.id ? ele.id : "-")) : ""));
    sw("reset");
    if (pauseAll) return;
    sw("run");

    //    if (debug>=3) { elegeta(SITE.listTitleXP).forEach(e => debugEle(e, "force"));elegeta(SITE.listTitleXP2).forEach(e => debugEle(e, "force")) }
    if (debug >= 3 && !(SITE.disableUrlRE && (location.href.match(SITE.disableUrlRE)))) {
      elegeta(SITE.listTitleXP).concat(elegeta(SITE.listTitleXP2)).forEach(e => {
        debugEle(e, "force autoRemove");
        //setTimeout(()=>{debugEle(e,"remove");},2000);
      });
    }
    // サイトごとの個別処理
    if (SITE.func) { SITE.func(node); }

    if (SITE.disableUrlRE && (SITE.disableUrlRE.test(location.href))) { return; }

    // ホバー時の操作案内のポップアップを登録
    //    if (ENABLE_HELP_CONCLUSION) {
    if ((debug >= 1 || ENABLE_HELP_CONCLUSION) && !(SITE.disableUrlRE && (location.href.match(SITE.disableUrlRE)))) {
      var lh = (!isDetail && SITE.helpInBlock) ? $("<span class='ignoreMe phov' style='cursor:pointer; color:#505050; font-size:90%; background:#ffffffb0; padding:0px 4px 0px 4px; border-radius:9px;border:#505050 1px solid; position: absolute; bottom:2px; right: 20em;' title='クリックでこのガイドを一時的に消す'>Q:非表示 W:アンドゥ 1:○メモ 2:×メモ</span>") : $("<span class='ignoreMe phov' style='all:initial; cursor:pointer; z-index:100; color:#505050; font-size:90%; background:#ffffffc0; padding:3px; border-radius:9px;border:#505050 1px solid; position:fixed; bottom:1em; right: 1em;' title='クリックでこのガイドを一時的に消す'>Q:非表示 W:アンドゥ 1:○メモ 2:×メモ</span>");
      //var lh2 = $("<span class='ignoreMe phov' style='all:initial; cursor:pointer; z-index:2147483647; color:#505050; font-size:90%; background:#ffffffc0; padding:3px; border-radius:9px;border:#505050 1px solid; position:fixed; bottom:1em; right: 1em;' title='クリックでこのガイドを一時的に消す'>Q:非表示 W:アンドゥ</span>");
      var lh2 = $(`<span class='ignoreMe phov2' style='all:initial; cursor:pointer; z-index:2147483647; color:#505050; font-size:90%; background:#ddeeffc0; padding:3px; border-radius:9px;border:#304050 1px solid; position:fixed; bottom:1em; right: 1em;' title='クリックでこのガイドを一時的に消す'>${SITE.XP2name||""}Q:非表示 W:アンドゥ${ SITE.XP2memo?" 1:○メモ 2:×メモ":""}</span>`);
      // 画面全体=詳細画面の方
      if (SITE.detailURLRE && location.href.match(SITE.detailURLRE)) {
        $('span.phov').remove();
        lh.appendTo(document.body).click(function() { $(this).fadeOut(100).queue(function() { $(this).remove() }) });
        sw("zentai help");
        //SITE.listTitleXP2 + "" → SITE.listTitleXP2 + "/../.."
        $(node).find(elegeta(SITE.listHelpXP2 || (SITE.listTitleXP2 ? SITE.listTitleXP2 + "" : undefined))).off("mouseenter mouseleave").hover(function() {
          $('span.phov').fadeTo(0, 0);
          lh2.appendTo(document.body).click(function() { $(this).fadeOut(100).queue(function() { $(this).remove() }) });
        }, function() {
          $(".phov2").remove();
          $('span.phov').fadeTo(0, 1);
        }); // test
      } else {
        // 1行単位=検索結果&セラー画面の方
        if (runmode !== "observed") { // 初処理+追記部分のみ=重複しない処理
          $(node).find(SITE.listHelpJQS || elegeta(SITE.listHelpXP || (SITE.listTitleXP ? SITE.listTitleXP + "/../.." : undefined))).off("mouseenter mouseleave").hover(function() { lh.appendTo(SITE.helpInBlock ? this : document.body).click(function() { $(this).fadeOut(100).queue(function() { $(this).remove() }) }); }, function() { $(".phov").remove() });
          //          $(node).find(elegeta(SITE.listHelpXP2 || (SITE.listTitleXP2 ? SITE.listTitleXP2 + "" : undefined))).off("mouseenter mouseleave").hover(function() { lh2.appendTo(document.body).click(function() { $(this).fadeOut(100).queue(function() { $(this).remove() }) }); }, function() { $(".phov").remove() });
          $(node).find(elegeta(SITE.listHelpXP2 || (SITE.listTitleXP2 ? SITE.listTitleXP2 + "" : undefined))).off("mouseenter mouseleave").hover(function() {
            $('span.phov').fadeTo(0, 0);
            lh2.appendTo(document.body).click(function() { $(this).fadeOut(100).queue(function() { $(this).remove() }) });
          }, function() {
            $(".phov2").remove();
            $('span.phov').fadeTo(0, 1);
          }); // test
        } else { // 重複ありの処理
          $(node).find(SITE.listHelpJQS || elegeta(SITE.listHelpXP || (SITE.listTitleXP ? SITE.listTitleXP + "/../.." : undefined))).off("mouseenter mouseleave").hover(function() { lh.appendTo(SITE.helpInBlock ? this : document.body).click(function() { $(this).fadeOut(100).queue(function() { $(this).remove() }) }); }, function() { $(".phov").remove() });
          //          $(node).find(elegeta(SITE.listHelpXP2 || (SITE.listTitleXP2 ? SITE.listTitleXP2 + "" : undefined))).off("mouseenter mouseleave").hover(function() { lh2.appendTo(document.body).click(function() { $(this).fadeOut(100).queue(function() { $(this).remove() }) }); }, function() { $(".phov").remove() });
          $(node).find(elegeta(SITE.listHelpXP2 || (SITE.listTitleXP2 ? SITE.listTitleXP2 + "" : undefined))).off("mouseenter mouseleave").hover(function() {
            $('span.phov').fadeTo(0, 0);
            lh2.appendTo(document.body).click(function() { $(this).fadeOut(100).queue(function() { $(this).remove() }) });
          }, function() {
            $(".phov2").remove();
            $('span.phov').fadeTo(100, 1);
          }); // test
        }
        sw("1gyou help");
      }
    }

    // 高速化のためにtitleXP/2の要素のtextContentに含まれるメモ・NGだけの集合を作る>documemtのtextContent>documemtのinnerHTML の順
    let fastmode = !fasttest ? null : !(/\+\+alt\+\+|\+\+title\+\+|\+\+url\+\+|\*\*url\*\*/.test(SITE.listTitleSearchXP + " " + SITE.detailTitleSearchXP + " " + SITE.listTitleMemoSearchXP));
    let fasttext = !fasttest ? null : fastmode ? node.textContent : node.innerHTML;
    var fastMatch = !fasttest ? null : fastmode ? (SITE.listTitleXP ? elegeta(SITE.listTitleXP, node) : []).concat((SITE.listTitleXP2 ? elegeta(SITE.listTitleXP2, node) : [])).concat((SITE.detailTitleXP ? elegeta(SITE.detailTitleXP, node) : [])) : null;
    sw("use fast test")
    if (fasttest && fastmode) { sw("draft with fastMatch") } else { sw("draft with innerHTML") }

    // メモ貼りを実行 memo::
    if (runmode === "observed" || runmode === "returned") {
      sw("reset");
      $('span[data-mbt="1"]').remove();
      sw("removing memo");
    }
    var isnotChrome = (window.navigator.userAgent.toLowerCase().indexOf('chrome') == -1);

    if (pref(SITE.id + ' : SearchMyMemo')) {
      var i = 0;
      var hitTitle = [];
      var titles = pref(SITE.id + ' : SearchMyMemo')
      if (fasttest) {
        if (fastMatch) {
          for (let ele of fastMatch) { hitTitle = hitTitle.concat(titles.filter(t => { return ele.textContent.indexOf(t.t) !== -1 })); } sw("mymemo draft-test");
        } else {
          hitTitle = hitTitle.concat(titles.filter(t => { return fasttext.indexOf(t.t) !== -1 }));
        }
        hitTitle = [...new Set(hitTitle)];
        for (let a of hitTitle.sort(function(a, b) { return isnotChrome ? (a.c == COLORCPUSCORE && b.c !== COLORCPUSCORE ? 1 : 0) : (a.c != COLORCPUSCORE && b.c == COLORCPUSCORE ? -1 : 0); })) { memoByTitle(a.t, a.m, node, a.c || COLOR1); }
      } else {
        for (let a of pref(SITE.id + ' : SearchMyMemo').sort(function(a, b) { return isnotChrome ? (a.c == COLORCPUSCORE && b.c !== COLORCPUSCORE ? 1 : 0) : (a.c != COLORCPUSCORE && b.c == COLORCPUSCORE ? -1 : 0); })) {
          memoByTitle(a.t, a.m, node, a.c || COLOR1);
        }
      }
    }
    sw("mymemo ( draft-matched : " + ((hitTitle || []).length) + " )"); //JSON.stringify(hitTitle)

    // 非表示を実行 hide::
    //    var help = (KEYHIDE + ":非表示 " + KEYUNDO + ":アンドゥ " + (SITE.disableKeyB ? "" : KEYBW + ":NGワード ") + KEYEDIT + ":NG編集 " + KEYMEMO1 + KEYMEMO2 + ":メモを追加 " + KEYMEMO1S + KEYMEMO2S + ":自由メモ " + KEYRESETMEMO + ":メモを編集 " + KEYRESETMEMOAUTO + ":自動メモのみ全削除 " + KEYTOGGLEtranslucent + ":半透明") + (SITE.wholeHelp || "");
    //    var help = (KEYHIDE + ":非表示 " + KEYUNDO + ":アンドゥ " + (SITE.disableKeyB ? "" : KEYBW + ":NGワード ") + KEYEDIT + ":NG編集 " + KEYMEMO1 + KEYMEMO2 + ":メモを追加 " + KEYMEMO1S + KEYMEMO2S + ":自由メモ "  + KEYMEMO5 + KEYMEMO6 + ":定型メモ " + KEYRESETMEMO + ":メモを編集 " + KEYRESETMEMOAUTO + ":自動メモのみ全削除 " +KEYMEMO5EDIT+"/"+KEYMEMO6EDIT+":定型メモを編集 "+ KEYTOGGLEtranslucent + ":半透明") + (SITE.wholeHelp || "");
    var help = (KEYHIDE + ":非表示 " + KEYUNDO + ":アンドゥ " + (SITE.disableKeyB ? "" : KEYBW + ":NGワード ") + KEYEDIT + ":NG編集 " + KEYMEMO1 + KEYMEMO2 + ":メモを追加 " + KEYMEMO1S + KEYMEMO2S + ":自由メモ " + KEYMEMO5 + KEYMEMO6 + ":定型メモ " + KEYRESETMEMO + ":メモを編集 " + KEYRESETMEMOAUTO + ":自動メモのみ全削除 " + KEYTOGGLEtranslucent + ":半透明") + (SITE.wholeHelp || "");
    if (pref(SITE.id + ' : SearchHideTitle')) {
      var i = 0;
      var hitTitle = [];
      var titles = pref(SITE.id + ' : SearchHideTitle');
      if (fasttest) {
        if (fastMatch) {
          for (let ele of fastMatch) {
            var a = titles.filter(t => ele.textContent.indexOf(t) !== -1);
            if (a) hitTitle = hitTitle.concat(a);
          } //console.log(hitTitle)
        } else {
          hitTitle = titles.filter(t => { return fasttext.indexOf(t) !== -1 });
        }
        hitTitle = [...new Set(hitTitle)];
        sw("block draft-test");
        for (let title of hitTitle || []) { i += hideByTitle(title, node); }
        sw("block ( actually : " + i + " / draft-matched : " + ((hitTitle || []).length) + (fastMatch ? " / target : " + fastMatch.length : "") + " )");
      } else {
        for (let title of pref(SITE.id + ' : SearchHideTitle') || []) { i += hideByTitle(title, node); }
        sw("block ( actually : " + i + "  )");
      }
      if (i) { help = i + "個を非表示にしました<BR>" + help + (debug && fasttest ? " <br><br>ドラフトでマッチ:" + (JSON.stringify(hitTitle.slice(0, 9))) : ""); }
    }
    // 全体ヘルプを表示
    if (debug || (ENABLE_HELP_CONCLUSION && (SITE.helpOnDNI || (runmode === "1st" && SITE.listTitleXP)) && !(SITE.disableUrlRE && (location.href.match(SITE.disableUrlRE))))) popup2(help, 1);

    // 自動メモを探索&製作
    //    if (isDetail) { for (let t = 0; t < ENABLE_AUTOMEMO; t++) { setTimeout(makeautomemo, 500 + t * 3000); } } //debug&&t>0?popup3( t * t / 2 * 1000,2,1):0; }
    //    if (isDetail) { for (let t = 0; t < ENABLE_AUTOMEMO; t++) { setTimeout(makeautomemo, 0 + t * 3071); } } //debug&&t>0?popup3( t * t / 2 * 1000,2,1):0; }
    if (isDetail || (SITE.automemoForceFunc && SITE.automemoForceFunc())) {
      for (let t = 0; t < ENABLE_AUTOMEMO; t++) { setTimeout(makeautomemo, (document.hidden ? 0 : 500) + t * 3000); }
      sw("automemo");
    } //debug&&t>0?popup3( t * t / 2 * 1000,2,1):0; }

    function makeautomemo() {
      if (ENABLE_AUTOMEMO && SITE.automemoURLRE && (location.href.match(SITE.automemoURLRE))) {
        SITE.automemoFunc();
      }
    }

    /*
    if (HIGHLIGHT_FOR_GUIDE) {
      setInterval(() => {
        (SITE.listTitleXP ? elegeta(SITE.listTitleXP) : []).concat(SITE.listTitleXP2 ? elegeta(SITE.listTitleXP2) : []).forEach(e => { debugEle(e, "force autoRemove random"); }); }, 500);
    }
    */
    return;
  }

  function restoreTranslucent() {
    if (pref(SITE.id + ' : SearchHideTitle')) {

      //            for (let title of pref(SITE.id + ' : SearchHideTitle') || []) showByTitle(title, 0);
      var fastmode = !fasttest ? null : !(/\+\+alt\+\+|\+\+title\+\+|\+\+url\+\+|\*\*url\*\*/.test(SITE.listTitleSearchXP + " " + SITE.detailTitleSearchXP + " " + SITE.listTitleMemoSearchXP));
      var fasttext = !fasttest ? null : fastmode ? document.body.textContent : document.body.innerHTML;
      var fastMatch = !fasttest ? null : fastmode ? (SITE.listTitleXP ? elegeta(SITE.listTitleXP) : []).concat((SITE.listTitleXP2 ? elegeta(SITE.listTitleXP2) : [])).concat((SITE.detailTitleXP ? elegeta(SITE.detailTitleXP) : [])) : null;
      dc(fastmode ? "restoreTranslucent : use fastmode" : "restoreTranslucent : not use fastmode")
      sw("reset")
      var i = 0;
      var hitTitle = [];
      var titles = pref(SITE.id + ' : SearchHideTitle');
      if (fasttest) {
        if (fastMatch) {
          for (let ele of fastMatch) {
            //  var a = titles.find(t => ele.textContent.indexOf(t) !== -1);
            //  if (a) hitTitle.push(a)
            var a = titles.filter(t => ele.textContent.indexOf(t) !== -1);
            if (a) hitTitle = hitTitle.concat(a);
          }
        } else {
          hitTitle = titles.filter(t => { return fasttext.indexOf(t) !== -1 });
        }
        hitTitle = [...new Set(hitTitle)];
      } else {
        hitTitle = pref(SITE.id + ' : SearchHideTitle') || []
      }
      for (let title of hitTitle) showByTitle(title, 0);
      sw("restoreTranslucent")
    }
    if (SITE.funcOnTOn) SITE.funcOnTOn();
  }

  function eletext(xpa, xp) {
    if (typeof xpa == "string") { // string
      let e = eleget0(xpa);
      if (e) debugEle(e);
      return e ? e.innerText : "";
    } else { // array
      let text = "";
      xpa.forEach(xp => {
        elegeta(xp).forEach(e => {
          debugEle(e);
          text = text + (e.innerText + "\n");
        })
      })
      return text;
    }
  }

  function autoMemo(re, text) {
    let automemotarget = SITE.automemoSearchFunc();
    let node = document.body;
    let sou = automemotarget.match(re);
    if (sou && sou.length) {
      sou.shift();
      var memo = Array.from(new Set(sou)).join(" ").replace(/[A-Za-z0-9.,]/g, function(s) { return String.fromCharCode(s.charCodeAt(0) - 65248) }).replace(/\s{2,99}| /gm, " ").trim();
      // node.innerHTML=node.innerHTML.replace(re,"<mark>$1</mark>");
      var title = getTitle();
      if (!title) return;
      var tmp = pref(SITE.id + ' : SearchMyMemo') || [];
      var isExist = tmp.filter(e => e.t == title && e.m == memo);
      if (isExist.length == 0) {
        if (debug) popup3(memo, 2, 1, 5000);
        storeMemo(title, memo, COLOR3, node);
      }
      return true;
    }
    return false;
  }

  function getTitle(x, y) {
    var ele = (SITE.detailTitleXP && isDetail) ? eleget0(SITE.detailTitleXP) : document.elementFromPoint(mousex, mousey);
    if (!ele) return;
    var title = getTitleFromParent(ele);
    if (!title) return;
    return title;
  }

  function getTitleFromParent(ele, nodisplay = 0) { // ele要素の親の出品物タイトルを返す
    if (!nodisplay) dc("start at : " + ele.innerText);
    //    if (isDetail) return tri((SITE.useText ? ele.textContent.replace(/\|/g, '\|') : ele.title || ele.textContent.replace(/\|/g, '\|') || ele.alt));
    if (isDetail) return tri((SITE.useText ? ele.textContent.replace(/\|/g, '\|') : SITE.useURL ? ele.getAttribute("href").replace(/\?.*$/, "") : ele.title || ele.textContent.replace(/\|/g, '\|') || ele.alt));
    for (let i = 0; i < (SITE.listGen); i++) {
      if (!nodisplay) dc("go up to now (" + i + ") : " + ele.innerText)
      var ele2 = elegeta(SITE.listTitleXP, ele);
      if (!nodisplay) dc("length:" + ele2.length)
      if (ele2.length === 1 || (SITE.searchAllowLength && ele2.length)) {
        if (!nodisplay) dc("href : " + ele2[0].getAttribute("href") + "\ntitle : " + tri((ele2[0].title + " \ntextContent : " + ele2[0].textContent.replace(/\|/g, '\|') + " \nalt : " + ele2[0].alt)));
        return SITE.useURL ? ele2[0].getAttribute("href").replace(/\?.*$/, "") : SITE.useText ? tri(ele2[0].textContent.replace(/\|/g, '\|')) : tri((ele2[0].title || ele2[0].textContent.replace(/\|/g, '\|') || ele2[0].alt));
      }
      if (ele === document) return;
      ele = ele.parentNode;
    }
    return;
  }

  function tri(str) {
    if (!str) return "";
    if (str.match(/\"/)) { popup3("項目名に \" を含むので多分うまく処理できません"); return ""; }
    return (SITE.trim) ? str.trim() : str;
  }

  function memoElement(ele, node, color = COLOR1, memoword = "") { //12 memo
    if (!ele) return;
    var title = typeof ele === "string" ? ele : getTitleFromParent(ele);
    if (!title) return;
    if (SITE.titleProcessFunc) title = SITE.titleProcessFunc(title);
    if (!title) return;
    var memo = memoword || (prompt("『" + title + "』\nのメモを書いてください") || "").trim();
    storeMemo(title, memo, color, node);
    return true;
  }

  function storeMemo(title, memo, color = COLOR1, node = document) {
    if (title && memo) {
      let tmp = pref(SITE.id + ' : SearchMyMemo') || [];

      var isExist = tmp.filter(e => e.t === title && e.c === color && e.m === memo); // 重複してなければ
      if (isExist.length == 0) {

        tmp.push({ t: title, m: memo, c: color })
        pref(SITE.id + ' : SearchMyMemo', tmp)
        memoByTitle(title, memo, node, color);
      }
    }
  }

  function memoByTitle(title, memo, node, color) {
    if (title.indexOf('"') != -1) return; // todo:タイトルに"があると正しく検索できないので処理しない
    var xp = SITE.listTitleMemoSearchXP.replaceTitle(title);
    for (let titleEle of elegeta(xp, node)) {
      if (titleEle) {
        let ele = SITE.listTitleMemoSearchXPSameGen ? titleEle.parentNode.insertBefore(document.createElement("span"), titleEle.nextSibling) : titleEle.parentNode.parentNode.insertBefore(document.createElement("span"), titleEle.parentNode.nextSibling);
        let isCPU = memo.match(/Pentium|Celeron|Core\s?i\d|Ryzen|GHz|AMD.*APU/i);
        ele.dataset.mbt = "1";
        ele.className = "ignoreMe";
        ele.innerHTML = '<span class="ignoreMe yhmMyMemo ' + escape(title + memo + color) + '" title="『' + title + '』についたメモ(クリックで削除)' + (isCPU ? "\n\n右クリックでuserbenchmark検索\nhttps://duckduckgo.com/?q=!ducky+" + memo.replace(/[\u30a0-\u30ff\u3040-\u309f\u3005-\u3006\u30e0-\u9fcf\s]+/g, "+") + "+userbenchmark" : "") + '" style="' + MEMOSTYLE + (isCPU ? " cursor:help; " : "") + ' background-color:' + color + ';">' + memo + '</span>';
        $(ele).hide().fadeIn(SITE.observe ? 0 : 150);

        // CPUモデルナンバーを右クリックでuserbenchmark検索
        if (isCPU) {
          $(ele).appendTo($(ele)).on('contextmenu', (function(title, memo) {
            return function() {
              if (pref("lastItemName") == undefined) { // 前回の処理が終わってないとだめ
                pref("lastItemName", title);
                popup3(title);
                memo = memo.replace(/[\u30a0-\u30ff\u3040-\u309f\u3005-\u3006\u30e0-\u9fcf\s]+/g, "+");
                window.open("https://duckduckgo.com/?q=!ducky+" + memo + "+userbenchmark");
                setTimeout(() => {
                  if (pref("lastItemName")) {
                    popup3("Investigating " + memo + " timed out");
                    pref("lastItemName", "");
                  }
                }, 30000); // 30秒以内に見ないとだめ
              }
              return false;
            }
          })(title, memo));
        }
        setRemoveMemo(ele, title, memo, color)
      }
    }
  }

  function setRemoveMemo(ele, title, memo, color) { // メモをクリックで消す処理
    ele.onclick = (e) => {
      pref(SITE.id + ' : SearchMyMemo', (pref(SITE.id + ' : SearchMyMemo') || []).filter(n => !(n.t == title && n.m == memo && n.c == color)))
      for (let e of elegeta('//span[@class="ignoreMe yhmMyMemo ' + escape(title + memo + color) + '"]')) $(e).hide(200).queue(function() { $(this.parentNode).remove() }); //e.remove(); //ele.remove();
      e.preventDefault();
      e.stopPropagation();
    };
  }

  function blockElement(ele) { //Q:: toggle
    if (!ele) return;
    var title = getTitleFromParent(ele);
    dc("got : " + title)
    addNG(title);
  }

  function hideByTitle(titleOrEle, node, targetXP = SITE.listTitleSearchXP) {
    let i = 0;
    if (!isDetail || SITE.hideListEvenDetail) {
      let resHit = [];
      if (SITE.listTitleSearchFunc) resHit = SITE.listTitleSearchFunc(titleOrEle); // 主に5ch用、レス中キーワードNG
      // 1項目ずつ
      for (let ele of typeof titleOrEle === "object" ? [titleOrEle] : elegeta(targetXP.replaceTitle(titleOrEle), node).concat(resHit)) { // titleがテキストなら項目タイトルにヒットする要素、DOM要素なら直接それを隠す
        i++;
        //        ele.dataset.hidden = "1";
        if (!disableHide) {
          $(ele).fadeOut(34);
          ele.dataset.hidden = "1";
          ele.dataset.yhmkey = titleOrEle;
        } else {
          ele.style.opacity = "0.75";
          setTimeout(function() { ele.style.opacity = "0.50" }, 17 * 2);
          ele.dataset.hidden = "2"; // 必要?
          ele.dataset.yhmkey = titleOrEle;
          if (debug) { elegeta('//*[text()="' + titleOrEle + '"]').forEach(e => { debugEle(e, "autoRemove") }) }
        }
      }
    }
    if (isDetail) {
      // 詳細:画面全体
      if (isDetail && SITE.detailTitleXP && SITE.detailTitleSearchXP) {
        var xp = SITE.detailTitleSearchXP.replaceTitle(titleOrEle) // isearでハイライトされていると×
        for (let ele of elegeta(xp, node)) {
          dc(xp, ele, ele.textContent);
          i++;
          ele.style.opacity = "0.5";
        }
      }
    }
    return i;
  }

  function showByTitle(titleOrEle, time = 34, xpath = SITE.listTitleSearchXP) {
    if (!isDetail || SITE.hideListEvenDetail) {
      let resHit = [];
      if (SITE.listTitleSearchFunc) resHit = SITE.listTitleSearchFunc(titleOrEle);
      // 1項目ずつ
      //var xp = xpath.replaceTitle(titleOrEle);
      for (let ele of typeof titleOrEle === "object" ? [titleOrEle] : elegeta(xpath.replaceTitle(titleOrEle)).concat(resHit)) {
        ele.style.opacity = "1";
        $(ele).fadeIn(time);
        //        delete ele.dataset.hidden;
        ele.dataset.hidden = null; //ele.dataset.yhmkey=null;
        //setTimeout(function() { ele.style.opacity = "1" }, 17 * 2);
      }
    }
    if (isDetail) {
      // 詳細:画面全体
      if (isDetail && SITE.detailTitleXP && SITE.detailTitleSearchXP) {
        var xp = SITE.detailTitleSearchXP.replaceTitle(titleOrEle) // isearでハイライトされていると×
        for (let ele of elegeta(xp)) { ele.style.opacity = "1"; }
      }
    }
  }

  function addNGWord() {
    var newWord = (prompt("非表示にしたい項目のタイトルが含むNGワードを入力してください\n\n現在の全体\n" + JSON.stringify(pref(SITE.id + ' : SearchHideTitle') || []) + "\nに追加されます\n\n") || "").trim();
    addNG(newWord);
  }

  function addNG(title) {
    if (!title) return;
    if (SITE.titleProcessFunc) title = SITE.titleProcessFunc(title);
    if (!title) return;
    let resist = pref(SITE.id + ' : SearchHideTitle') || [];
    let i = resist.indexOf(title);
    if (i !== -1) {
      resist.splice(i, 1);
      pref(SITE.id + ' : SearchHideTitle', resist);;
      popup2("『" + title + "』<br>を非表示登録から削除しました", 1);
      showByTitle(title);
      if (isDetail && SITE.showFunc) SITE.showFunc();
    } else {
      resist.push(title);
      pref(SITE.id + ' : SearchHideTitle', resist);
      popup2("『" + title + "』<br>を非表示登録しました(" + KEYUNDO + ":取り消し " + KEYEDIT + ":編集)", 1);
      hideByTitle(title);
    }
  }

  // キャッシュ付き
  var elegetaCacheXP = "";
  var elegetaCacheLastTime = new Date();
  var elegetaCacheResult = [];
  var elegetaCacheNode = "";
  var ehit = 0;
  var emiss = 0;

  function elegeta(xpath, node = document) {
    if (!xpath) return [];
    /*    //    if (xpath === elegetaCacheXP && node === elegetaCacheNode && ((new Date().getTime() - elegetaCacheLastTime) < 100)) {
        if (xpath === elegetaCacheXP && node === elegetaCacheNode && ((new Date().getTime() - elegetaCacheLastTime) < 100)) {
          //console.log(++ehit,emiss,ehit/(ehit+emiss)*100+"% hits");
          //elegetaCacheLastTime = new Date().getTime();
          return elegetaCacheResult;
        } // 100ms以内ならキャッシュを返す
        elegetaCacheXP = xpath;
        elegetaCacheLastTime = new Date().getTime();
        elegetaCacheNode = node;
        //console.log(ehit,++emiss,ehit/(ehit+emiss)*100+"% hits");
    */
    try {
      var array = [];
      var ele = document.evaluate("." + xpath, node, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
      let l = ele.snapshotLength;
      for (var i = 0; i < l; i++) array[i] = ele.snapshotItem(i);
      //      elegetaCacheResult = array;
      return array;
    } catch (e) { popup2(e + "<br>" + xpath, 1); return []; }
  }

  function eleget0(xpath, node = document) {
    if (!xpath) return null;
    try {
      var ele = document.evaluate("." + xpath, node, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
      return ele.snapshotLength > 0 ? ele.snapshotItem(0) : "";
    } catch (e) { popup2(e + "<br>" + xpath, 1); return null; }
  }

  function popup3(text, i = 0, lf = 1, timer = 15000, alignY = "bottom") {
    if (!ENABLE_HELP_CONCLUSION) return;
    if (text == undefined) return;
    if (typeof text == "string") text = text.slice(0, 200);
    let id = Math.random().toString(36).substring(2);
    //    let ele = document.body.appendChild(document.createElement("span"));
    //    ele.outerHTML = '<span id="yhmbox' + id + '" class="ignoreMe" style="all:initial;font-family:sans-serif; position: fixed; right:0em; ' + alignY + ':' + ((maey + i) * 1 + 0) + 'em; z-index:2147483647; opacity:1; font-size:90%; margin:0px 1px; text-decoration:none !important;  padding:1px 6px 1px 6px; word-break: break-all !important; border-radius:12px; background-color:#6080ff; color:white; ">' + text + '</span>';
    var ele = $('<span id="yhmbox' + id + '" class="ignoreMe" style="all:initial;font-family:sans-serif; position: fixed; right:0em; ' + alignY + ':' + ((maey + i) * 1 + 0) + 'em; z-index:2147483647; opacity:1; font-size:90%; margin:0px 1px; text-decoration:none !important;  padding:1px 6px 1px 6px; word-break: break-all !important; border-radius:12px; background-color:#6080ff; color:white; ">' + text + '</span>').appendTo('body');
    maey += lf + 1;
    if (typeof text == "string") { maey += (text.match(/<br>/gmi) || []).length || 0; } //console.log((text.match(/<br>/gmi) || [] ).length) }
    setTimeout(() => {
      eleget0('//span[@id="yhmbox' + id + '"]').remove();
      maey = 0;
    }, timer);
  }
  var maet;

  function popup2(text, i = 0) {
    if (!ENABLE_HELP_CONCLUSION) return;
    var mae = eleget0('//span[@id="yhmbox"]');
    if (maet && mae) {
      mae.remove();
      clearTimeout(maet);
    }
    let bgcol = (pref("translucent") != "on") ? "#6080ff" : "#909090";
    var ele = $('<span id="yhmbox" class="ignoreMe" style="all:initial; font-family:sans-serif; cursor:pointer; position: fixed; right:0em; bottom: ' + (i * 2 + 2) + 'em; z-index:2147483647; opacity:1; font-size:90%; margin:0px 1px; text-decoration:none !important; padding:1px 6px 1px 6px; word-break: break-all !important; border-radius:12px; background-color:' + bgcol + '; color:white; ">' + text + '</span>').appendTo('body');
    maet = setTimeout(function() {
      var mae = eleget0('//span[@id="yhmbox"]');
      if (mae) { mae.remove(); }
    }, 5000);
    $(ele).attr("title", "クリックでこのガイドを一時的に消す").click(function() {
      $(this).fadeOut(200).queue(function() {
        $(this).remove();
        clearTimeout(maet);
      })
    });
  }

  function pref(name, store = null) { // prefs(name,data)で書き込み(数値でも文字列でも配列でもオブジェクトでも可)、prefs(name)で読み出し
    if (store === null) { // 読み出し
      let data = GM_getValue(name) || GM_getValue(name);
      if (data == undefined) return null; // 値がない
      if (data.substring(0, 1) === "[" && data.substring(data.length - 1) === "]") { // 配列なのでJSONで返す
        try { return JSON.parse(data || '[]'); } catch (e) {
          alert("データベースがバグってるのでクリアします\n" + e);
          pref(name, []);
          return;
        }
      } else return data;
    }
    if (store === "" || store === []) { // 書き込み、削除
      GM_deleteValue(name);
      return;
    } else if (typeof store === "string") { // 書き込み、文字列
      GM_setValue(name, store);
      return store;
    } else { // 書き込み、配列
      try { GM_setValue(name, JSON.stringify(store)); } catch (e) {
        alert("データベースがバグってるのでクリアします\n" + e);
        pref(name, "");
      }
      return store;
    }
  }

  function prefRestrict(name, type) {
    let data = pref(name);
    if (!data) return data;
    if (type === "array") {
      if (typeof data === "object") {
        //            alert("correct");
        return data;
      } else {
        alert("データベースの形式に誤りがある(配列/オブジェクトでない)ためクリアします\n");
        pref(name, "");
        return [];
      }
    }
    return data;
  }

  function debugEle(ele, command = "") {
    if (!ele) return
    if (command.indexOf("remove") !== -1) {
      ele.style.outline = "";
      ele.style.boxShadow = "";
      return;
    }
    if (ENABLE_HELP_CONCLUSION && (debug || command.indexOf("force") !== -1)) {
      var col = getColorFromText(ele.innerText);
      if (command.indexOf("random") !== -1) col = '#' + (0x1000000 + (Math.random()) * 0xffffff).toString(16).substr(1, 6);
      ele.style.outline = "3px dotted " + col;
      ele.style.boxShadow = " 0px 0px 4px 4px " + col + "30, inset 0 0 100px " + col + "20";
      //      ele.title='\n@class="'+ele.className+'"\n@id="'+ele.id+'"';
      if (command.indexOf("autoRemove") !== -1) {
        setTimeout(() => {
          ele.style.outline = "";
          ele.style.boxShadow = "";
        }, 60000)
      }
    }
  }

  function getColorFromText(str) {
    if (!str) return "#808080"
    var col = 0;
    for (letter of str) { col = (col + str.charCodeAt(letter) ** 3); }
    return '#' + (0x1000000 + col % 0xffffff).toString(16).substr(1, 6);
  }

  function advertiseEle(ele, force = "") {
    if (debug || force == "force") {
      if (ele) ele.style.outline = "4px dotted red";
    }
  }

  function sw(job, mode = "dc") {
    //    if (ENABLE_MEASURE_TIME_SPENT == 0) return;
    if (debug < 2 && !ENABLE_MEASURE_TIME_SPENT) return;
    if (job !== "reset") {
      if (mode === "dc") dc(job + " : " + ((new Date().getTime()) - (swb.getTime())) + " ms");
      if (mode === "notify") notifyMe(job + " : " + ((new Date().getTime()) - (swb.getTime())) + " ms");
    }
    if (job !== "reset")
      swb = new Date();
  }

  function isSeller() {
    return location.href.match(/\/seller\//);
  }

  function dc(str) {
    if (debug == 1) console.log(str);
    if (debug >= 2) popup3(str, 0, 1, 15000, "top");
    return str;
  }

  function notifyMe(body, title = "") {
    if (!("Notification" in window)) return;
    else if (Notification.permission == "granted") new Notification(title, { body: body });
    else if (Notification.permission !== "denied") Notification.requestPermission().then(function(permission) {
      if (permission === "granted") new Notification(title, { body: body });
    });
  }

  function setupbutton(id, title, func, tips, command) {
    $(`<span id='${id}' class='ignoreMe' title='${tips}' style='cursor:pointer; color:#505050; font-size:90%; background:#ffffffc0; padding:3px; border-radius:9px;border:#505050 1px solid; position:fixed; bottom:3em; right: 1em;'>${title}</span>`).appendTo(document.body).click(function() { func(); if (/removeWhenClicked/.test(command)) { $(this).remove(); } });
  }

})();