${res1[i].innerHTML}
${res2o.replace(/^/,"").replace(/<\/dd>/,"")}
// ==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 *://www.nicovideo.jp/watch/* // @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 *://360life.shinyusha.co.jp/* // @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 *://*.shitaraba.net/bbs/read_archive.cgi/* // @match *://*.ftbucket.info/* // @match *://kuzure.but.jp/* // @match *://*.2chan.net/* // @match *://anige.horigiri.net/* // @match *://futapo.futakuro.com // @match *://futapo.futakuro.com/* // @match *://kako.futakuro.com/futa/* // @match https://kakaku.com/pc/note-pc/itemlist.aspx // @match https://kakaku.com/pc/desktop-pc/itemlist.aspx // @match *://btopc-minikan.com/* // @match *://pcfreebook.com/* // @version 0.5.55 // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @grant GM_addStyle // @grant GM.setClipboard // @run-at document-idle // @namespace https://greasyfork.org/users/181558 // @require https://code.jquery.com/jquery-3.4.1.min.js // @downloadURL none // ==/UserScript== (function() { const REPLACE_LINK_IN_YOUTUBE = 1; // 1:YouTubeで投稿者のチャンネルのホームタブへのリンクをチャンネルの動画タブへのリンクに置き換える const FUTABA_FLOAT_RELOAD_BUTTON = 1; // 1:ふたばでリロードボタンを浮遊させる const FUTABA_REPLACE_POPUP_FUNCTION = 1; // 1:ふたばで本文の引用ポップアップを置き換える const FUTABA_HOVER_DELAY = 1; // ふたばで>引用の上に静止してn/60秒間後にポップアップを表示する -1:瞬間&低負荷(mousemove) 1~:n/60秒(interval) const ftbBGC = 0 ? "#f0e0d6" : "#ffffee" const ENABLE_HELP = 1; // 1:操作ガイドを表示 0:無効 const ENABLE_AUTOMEMO = 7; // 0:自動メモを無効 1でオン 2~7:大きくするほど一時的に表示が崩れる代わりに確実 const ENABLE_EXCEPT_YAJ = 1; // 1:ヤフオク以外でも有効 0:ヤフオクでのみ動作 var debug = 0; // 1~だとデバッグモード dc(text) 1:非対応ページでその旨表示など/コンソールにverbose表示 2:verboseをポップアップ(速度測定して表示 sw("項目"))&非表示にした原因に枠追加 3:Q/1/2等の対象要素を目立たせる const fasttest = 1; // 1:高速モードを試用 const KEYCHANGE_DEBUG = "disable"; // 押す度にdebugを0~3に切り替えるキー "Shift+D","disable"等 const WCA_HIDE_SOME_SITES = 0; // (Web漫画アンテナで)1:使いにくい又は遅いサイト(コミックライド、マンガPark、コミックファイア、コミックヴァルキリー、まんがライフSTORIA´、がうがうモンスター、Z、スポバトマンガ研究所、WEBコミックガンマ、COMICリュウ、新都社、COMIC FUZ、COMICフルール、comicグラスト)の項目を隠す 0:無効 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 futabapopupscale; var futabapicksizeL = 50; var futabapicksize = 100; var hovertimer = 0; var swb = new Date(); sw("reset") String.prototype.match0 = function(re) { let tmp = this.match(re); if (!tmp) { return null } else if (tmp.length > 1) { return tmp[1] } else return tmp[0] } // gフラグ不可 let inYOUTUBE = location.hostname.match0(/^www\.youtube\.com|^youtu\.be/); $.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", COLORVIDEOTIME = "#204020", 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; let kaisuuU = 0; var GF = {} // 上が優先 const SITEINFO = [{ id: 'pcfreebook.com', urlRE: '//pcfreebook.com/', listTitleXP: '//td[1]/a[@target="_blank" and @rel="noopener nofollow noreferrer"]', listTitleSearchXP: '//td[1]/a[@target="_blank" and @rel="noopener nofollow noreferrer"][+++]/ancestor::tr', listTitleMemoSearchXP: '//td[1]/a[@target="_blank" and @rel="noopener nofollow noreferrer"][+++]', listGen: 3, listTitleMemoSearchXPSameGen: 1, listTitleXPIgnoreNotExist: 1, observe: 2500, }, { id: 'btopc-minikan.com', urlRE: '//btopc-minikan.com/', titleProcessFunc: (title) => { return title.replace(/\n|\s/gmi, " ").trim() }, listTitleXP: '//span[@class="itemname"]', listTitleSearchXP: '//span[@class="itemname"][++title++]/ancestor::tr', listTitleMemoSearchXP: '//span[@class="itemname"][++title++]', listTitleMemoSearchXPSameGen: 1, useTitle: 1, listGen: 4, func: () => { elegeta('//td[1]/div[@class="notranslate"]|.//td[@class="CPUgrease-GraphCell-Maker"]').forEach(e => e.insertAdjacentHTML("beforeend", ` `)) }, listTitleXPIgnoreNotExist: 1, observe: 2500, }, { urlRE: /^https:\/\/kakaku.com\/pc\/note-pc\/itemlist\.aspx|https:\/\/kakaku\.com\/pc\/desktop-pc\/itemlist.aspx/, WhateverFirstAndEveryAPFunc: () => { if (!elegeta('//th[@class="sub thHeader" and contains(text(),"CPUスコア ")]')[0]) return popup3("A:CPUスコア単価で絞り込み", 4) $(".cps").remove() elegeta('//table/tbody/tr[@class="tr-border"]/td[10]').forEach(e => { let p = elegeta('//td[2]/ul/li[@class="pryen"]/a', e?.closest("tr"))[0] let b = e.parentNode let cpu = parseInt(e.innerText.replace(/\D/g, "")) let price = parseInt(p.innerText.replace(/\D/g, "")) e.insertAdjacentHTML("beforeend", `
`) // 埋め込み外部プレイヤー版 $(ele?.closest("td")).append(`
`) // 埋め込み外部プレイヤー版 break; // 一度に1つずつしかやらない } if (elea.length) setTimeout(() => embednv(), 2000 + elea.length * 10); } autoPagerized(() => { embednv() }) // youtube埋め込み var embedyt = () => { var elea = elegeta('//a[contains(@href,"youtube.com")][not(@yte)]|//a[contains(@href,"youtu.be")][not(@yte)]') for (let ele of elea.filter(e => isinscreen(e) || eleget0('.yhmMyMemo', e.closest("table")))) { // リロード回避のためpickされるものは先に読み込む //for (let ele of elea.filter(e => isinscreen(e))) { let url = ele.href //innerText; ele.setAttribute("yte", "yte"); var sm = (url.match(/h?ttps?:\/\/youtu\.be\/([^&?]+.*)\?t=(\d*).*$/i) || url.match(/h?ttps?:\/\/w?w?w?m?\.youtube\.com\/watch\?v=([^&]+.*)&t=(\d*).*$/i)) || url.match(/h?ttps?:\/\/youtu\.be\/([^&?]+)/i) || url.match(/h?ttps?:\/\/w?w?w?m?\.youtube\.com\/watch\?v=([^&]+)/i); if (!sm) continue $(ele?.closest("td")).append('
'); break; // 一度に1つずつしかやらない }; if (elea.length) setTimeout(() => embedyt(), 2000 + elea.length * 10); } autoPagerized(() => { embedyt() }) // fu画像埋め込み var embedimg = () => { var elea = elegeta('.rtd blockquote:not([ime])') for (let ele of elea.filter(e => isinscreen(e) || eleget0('.yhmMyMemo', e.closest("table")))) { // リロード回避のためpickされるものは先に読み込む let txt = ele.innerText; ele.setAttribute("ime", "ime"); //var sm = txt.match(/^fu\d+\.jpg$/gmi); var sm = txt.match(/^fu?\d+\.(jpg|jpeg|png|gif|bmp|webp)$/gmi); //if (!sm?.length) continue if (sm?.length) sm.forEach(v => $(ele?.closest("td")).append(`
`)) break; // 一度に1つずつしかやらない }; if (elea.length) setTimeout(() => embedimg(), 2000 + elea.length * 10); } autoPagerized(() => { embedimg() }) var popped = [] $(eleget0('//td/input[@value="返信する"]')).on("click", () => { setTimeout(() => shikomi(), 999) }) // 引用ポップアップ仕込み var cited = []; var resEnum = []; function shikomi() { $(elegeta('.cnw:not([idw])').filter(v => /ID\:|IP\:/.test(v.innerText))).attr("idw", "1").css({ 'color': '#f00', 'font-weight': '800' }) elegeta('.thre table .rtd .rsc,.thre table .res_no').forEach(e => { e.style.cursor = "pointer" e.setAttribute("onclick", "let num=this.textContent; let e=[...document.querySelectorAll('.rtd>.rsc,.thre table .res_no')].find(c=>c.textContent==num); if(e){e?.closest('table').scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center'})}"); //クリックで中心にスクロール let resno = e?.textContent e.closest('table').setAttribute("rsc", resno) e.closest('.rtd').dataset.rsc = resno e.closest('table').dataset.rsc = resno }) elegeta('.thre table tr').filter(e => !eleget0('.quo', e)).forEach(e => e.insertAdjacentHTML("beforeend", `
`)) // 逆引用を追加 //autoPagerized(() => { var issorted = eleget0('#sortType2') || eleget0('#sortType1') resEnum = []; cited = []; var resa = elegeta('//*[@class="thre"]/descendant::table/tbody/tr/td[@class="rtd"]').filter(e => !e.closest("#pickbox,.ftbpu,#respopup_area")).sort((a, b) => { return (Number(a.dataset.rsc) - Number(b.dataset.rsc)) }) $($.makeArray($(".thre .revQuote")).filter(e => !e.closest("#pickbox,.ftbpu"))).remove() //elegeta('//tr/td[@class="rtd"]/blockquote/font[contains(text(),">")]|//td[@class="rtd"]/blockquote/p/font[contains(text(),">")]').forEach((h, i) => { //引用行文字列 elegeta('//*[@class="thre"]/descendant::table/tbody/tr/td[@class="rtd"]/blockquote/font[contains(text(),">")]|//*[@class="thre"]/descendant::table/tbody/tr/td[@class="rtd"]/blockquote/p/font[contains(text(),">")]').filter(e => !e.closest("#pickbox,.ftbpu,#respopup_area")).forEach((h, i) => { //緑文字の引用行文字列 //h.style.cursor="pointer" //これをやるとちょっとうるさい var greenResNo = h.closest('table').dataset.rsc; //緑文字列があるレスのレス番 var eWord = h.textContent.match0(/^\>+(.+)$/); // >***の***部分 if (eWord) { resa.filter(e => e.textContent.indexOf(eWord) != -1).forEach((c, i) => { // c=***が含まれるレス let n = c.dataset.rsc; // ***が含まれるレスのレス番 if (i === 0 && !(!resEnum[n] && n == greenResNo)) { // i==0つまりスレの初出のそれにしかヒットしない if (!resEnum[n]) resEnum[n] = [] if (!resEnum[n].includes(greenResNo)) { resEnum[n].push(greenResNo) let onc = `let e=document.querySelector(\'table[rsc=\\\'${greenResNo}\\\']\'); if(e){e.scrollIntoView({ behavior: \'smooth\', block: \'center\', inline: \'center\'})} return false;`; //クリックで中心にスクロール let quo = $(`>>${greenResNo}`) $(`td.quo`, c.parentNode).append(quo) } } }) } }) } autoPagerized(() => { shikomi() }) // 引用ホバー GM_addStyle(".rtdAttract{background-color:#fed;}") if (location.href.match0(/ftbucket/) && !eleget0(`.csb`)) GM_addStyle(".rsc,.cnw,.cno{padding:0 0.5em 0 0;}") var latestHover; var latestlevel = 0 // if (FUTABA_HOVER_DELAY == 0) { document.addEventListener("mousemove", function(e) { hover() }, false); } else { hover_enter() } if (FUTABA_HOVER_DELAY == -1) { document.addEventListener("mousemove", function(e) { hover() }, false); } else { hover_enter() } function hover_enter() { hover(); setTimeout(hover_enter, 1 * 17); } function hover() { hovertimer++; let ele = document.elementFromPoint(mousex, mousey); if (ele && (FUTABA_HOVER_DELAY || (ele && latestHover != ele))) { var quoteDesEle = ele.tagName === "FONT" && ele.closest("table") ? ele : null; //ホバーしている黄土色文字の要素群 var hoverEle = quoteDesEle; //ele.tagName === "FONT" && ele.closest("table") ? [ele] : []; //ホバーしている黄土色文字の要素群 let level = Number(ele.closest(".ftbpu")?.dataset.level || 0); //if (debug) dc("quoteDesEle:" + quoteDesEle?.tagName) if (quoteDesEle && ((FUTABA_HOVER_DELAY == 0 && latestHover != quoteDesEle) || (FUTABA_HOVER_DELAY && hovertimer >= (Math.max(hoverEle?.closest('#pickbox') && FUTABA_HOVER_DELAY != -1 ? 2 : 0, FUTABA_HOVER_DELAY))))) { // ピックアップの中では遅延を少なくとも3にする var eWord = quoteDesEle?.textContent?.match0(/^\>+(.+)$/)?.trim(); // 引用文 var resa = elegeta('//td[@class="rtd"]').filter(e => !e.closest("#pickbox,.ftbpu,#respopup_area")) var hit0no = (replaceMainPopup && resa.find(a => a.textContent && a.textContent.indexOf(eWord) != -1))?.dataset?.rsc; //ヒットした最初のレス番号 if (hit0no < 0) return; var motoNumber = hoverEle.closest('table').getAttribute("rsc"); // ホバーしているレスのレス番号 // 逆引用 var hitResNo = hoverEle.dataset.rsc; // rscがある=レスの右側に追加した>>100型逆引用である、そのレス番号 if (hitResNo) { var lists = [] resa.forEach(c => { if (c.dataset.rsc == hitResNo) lists.push(c.closest("table").dataset.rsc) }) resEnum[hitResNo].forEach(e => resa.forEach(c => { if (c.dataset.rsc == e) lists.push(c.closest("table").dataset.rsc) })); // rscがある=レスの右側に追加した逆引用である、そのレス番号 } else { // レス本文内の引用 if (motoNumber) { var quoteStr = quoteDesEle?.textContent?.match0(/^\>+(.+)$/)?.trim(); // 文字列 if (quoteStr) { var hitEles = resa.filter(e => e.textContent.indexOf(quoteStr) !== -1) if (hitEles.length) { var hoverResNo = (replaceMainPopup && hoverEle.getAttribute("rsc")) //ホバーしているレス番号 //hits[0].classList.add("rtdAttract") var lists = hitEles.map(e => e.closest("table").dataset.rsc) } } } } // 表示 if (hitResNo || lists) { lists = lists.sort((a, b) => a - b) var hit0no = lists[0] //tables[0][0].getAttribute("rsc") //ヒットした最初のレス番号 var restable = elegeta('//td[@class="rtd"]/ancestor::table').filter(e => !e.closest("#pickbox,.ftbpu,#respopup_area")) var tables = lists.map(c => $(restable.find(e => e.dataset.rsc == c)).clone(true, true)) var lists2 = (hit0no == motoNumber) ? lists.slice(1) : lists if (debug) dc(`list : ${lists}\nlist2 : ${lists2}`, 0) if (debug) dc("既存:" + elegeta('.ftbpu').find(e => lists == e.dataset.list || lists2 == e.dataset.list2 || lists == e.dataset.list2)?.dataset.list) if ( !(elegeta('.ftbpu').find(e => lists == e.dataset.list || lists2 == e.dataset.list2 || lists == e.dataset.list2)) ) { // まだ重複するポップアップがなければ if (debug) dc(`list-sorted : ${lists}`, 0) let xr = mousex > document.documentElement.clientWidth * 2 / 3 let x = xr ? "right:0px;" : `left:${mousex-16}px;` var pu = $(` `); //ヒットした全部をポップアップする版 if (hit0no == motoNumber) { tables.shift() } // 1個目の引用が自分自身なら削除 if (tables.length) { tables.forEach(e => { $(pu).append(e) }); $(".thre:first()").append(pu) // reso[hoverEles[0].getAttribute("rscf") || hit0no].classList.add("rtdAttract") let eley = $(quoteDesEle).offset().top - $(window).scrollTop() + $(quoteDesEle).outerHeight() + 1; // 少し縮小 let marginheight = Math.min(window.innerHeight, document.documentElement.clientHeight) - eley let eleheight = $(pu).height() + 15; if (marginheight / eleheight < 1) $(pu).css({ "transform-origin": xr ? "top right" : "top left" }).delay(100).animate2({ "transform": `scale(${Math.max(futabapopupscale/100,marginheight/eleheight)})`, "opacity": "1" }, 100) domsort(pu[0], elegeta('//table', pu[0]), v => -v.getAttribute("rsc")) sdset() } } } } else { if (!hoverEle && eleget0('.ftbpu') && !(ele.closest(".ftbpu") || ele.closest("#slp") || ele.closest(".fvw_respop") || eleget0("#pdm"))) { $(".ftbpu").remove(); $(".rtdAttract").removeClass("rtdAttract") } if (latestHover != ele && ele.closest(".ftbpu,#slp,.fvw_respop")) { // levelが低い要素に降りたら上のは消す elegeta(".ftbpu").forEach(e => { if (e?.dataset?.level > level) { e.remove() } }) } } } latestlevel = ele?.closest(".ftbpu")?.dataset?.level || 0 latestHover = ele; //dc("latest:"+latestHover?.tagName) } setTimeout(() => { setSlider(eleget0('//hr[2]|//div[@id="head"]/hr'), 50, 100, 95, "ポップアップの最小スケール:***%", "FUTABA_popupScale", (val) => { futabapopupscale = val; }, 1, "style='float:right; font-size:16px; transform:scale(0.9);'"); }, 2100) // pick::メモの付いたレスを右上に列挙 var pick_overflow; if (is2chan || isftb || isftchan || iskurokako) { var pick = (force = 0) => { if (window.getSelection() == "" && $("#pickbox:hover").length == 0 && $('#pickbox:hidden').length == 0) { var res = [...new Set($.makeArray($('.thre table:has(span.yhmMyMemo)')))].filter(e => !e.closest("#pickbox,.ftbpu")); // 埋め込み動画はロードが発生するので無視 let update = (GF.res !== JSON.stringify(res.map(e => e.innerText).sort())) if (update || force) { GF.res = JSON.stringify(res.map(e => e.innerText).sort()) if (debug) popup2("更新:" + GF.res.slice(0, 200)) if (!pick_overflow) { var p = eleget0('#pickbox:not(:hover)'); if (p && p?.scrollHeight > p?.offsetHeight) { pick_overflow = 1; } } $("#pickbox").remove(); if (res.length) { let threR = $('#rightadfloat:visible')[0] ? document.documentElement.clientWidth - ($(".thre").offset().left + $('.thre').outerWidth()) : 3 if (1 || document.documentElement.clientWidth - threR > 1300) { $.makeArray($(".thre")).filter(e => !e.closest("#pickbox,.ftbpu"))[0].insertAdjacentHTML("beforeend", ``) //$.makeArray($(".thre")).filter(e => !e.closest("#pickbox,.ftbpu"))[0].insertAdjacentHTML("beforeend", ``) let pickbox = eleget0("#pickbox") res.forEach(e => { pickbox.appendChild($(e).clone(true, true).css({ "display": "revert", "margin-left": "auto", "margin-right": "0" })[0]) }) $("#pickbox .sod:contains('x')").css({ "font-size": "125%", "float": "right" }) if (pick_overflow) { $("#pickbox img").css({ "width": "auto", "max-height": Math.max(50, 125 - res.length * 5) + "px" }); $("#pickbox blockquote").css({ "margin": "5px 40px" }) } $("#pickbox .revQuote").after("
"); //css({ "display": "inline-block" }) $("#pickbox .yhmMyMemo,.revQuote").css({ "user-select": "none" }) if (update) { $("#pickbox").css({ "outline": "#f00 5px solid" }).delay(100).queue(() => { $("#pickbox").css({ "outline": "2px #8888 solid" }) }) } domsort(pickbox, elegeta('//table', pickbox).filter(e => e.closest("#pickbox")), v => -v.getAttribute("rsc")) sdset() } } pick2title(20) } } setTimeout(() => pick(), 2000) } setTimeout(pick, 2000) setInterval(() => { if (futabapicksize == futabapicksizeL) return; var p = eleget0('#pickbox:not(:hover)') if (p) { var lr = elegeta('//td[@class="rtd"]')?.filter(e => isinscreen(e, 1) && !e?.closest("#pickbox,.ftbpu,#respopup_area,[floated]"))?.map(e => { let r = e.getBoundingClientRect().right; return e?.closest('table')?.querySelector('.revQuote')?.getBoundingClientRect()?.right + 4 || r + 2 }).reduce((a, b) => a > b ? a : b, 0) || 0 var big = p.getBoundingClientRect().left - lr var bigabs = Math.abs(big) if (p.scrollHeight > p.offsetHeight) { futabapicksize = Math.max(futabapicksizeL, futabapicksize - (p.scrollHeight - p.offsetHeight) / 62); pick_overflow = 1; pick(1) } else if (big < 0) { var ff = elegeta('//td[@class="rtd"]')?.filter(e => isinscreen(e, 1) && !e?.closest("#pickbox,.ftbpu,#respopup_area,[floated]")) futabapicksize = Math.max(futabapicksizeL, futabapicksize - bigabs / 52); p.style.transform = `scale(${futabapicksize/100})` if (debug) dc("picksize:" + futabapicksize, 1) } } }, 52) window.addEventListener('resize', () => { futabapicksize = 100; pick(1) }) //window.addEventListener('focus', () => { futabapicksize = 100; pick(1) }) // ややうるさい setTimeout(() => { if (eleget0('#pickbox')) { setSlider(eleget0('//body'), 30, 100, 50, "ピックアップの最小スケール:***%", "FUTABA_pickupSize", (val) => { futabapicksizeL = val; futabapicksize = Math.min(100, ++futabapicksize) pick(1) }, 0, "style='position:fixed; right:5em; bottom:0.5em; font-size:16px; transform:scale(0.7);'"); } else { setSlider(eleget0('//hr[2]|//div[@id="head"]/hr'), 30, 100, 50, "ピックアップの最小スケール:***%", "FUTABA_pickupSize", (val) => { futabapicksizeL = val; futabapicksize = Math.min(100, ++futabapicksize) pick(1) }, 0, "style='float:right; font-size:16px; transform:scale(0.9);' floated='' "); } }, 2100) } function pick2title(len) { if (is2chan && /\s-\s[^-]*$/.test(document.title)) { // 0とpickのレス100文字までページタイトルにする let doctitle = document.title.match0(/(.+)\s-\s[^-]*$/) let intro = elegeta('.thre>blockquote,#pickbox blockquote:visible')?.slice(0, len)?.map(e => e.innerText?.replace(/\n/gm, " "))?.join(" ")?.replace(/[ \s\u200B-\u200D\uFEFF\u2028\u2029\u200eㅤ]{1,99}/g, " ")?.slice(0, 100) if (doctitle && intro) document.title = document.title.replace(/.+(\s-\s[^-]*)$/, `${intro}$1`) } } }, }, { 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', // 作者名で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, "") }, WhateverFirstAndEveryAPFunc: () => { $(".side_box").css({ "height": "100vh" }); popup3("Shift+F:re.Find2ch検索", 8, 5000) }, keyFunc: [{ key: 'Shift+F', // Shift+F::refind2chでキーワード検索 func: () => { searchWithHistory("REFIND2CH", "re.Find2ch", 'https://refind2ch.org/search?q=***&sort=rate', " OR ") }, }], 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;"; } elegeta('//div[@id="content_main"]/div[@id="search_results"]/a', node).forEach(e => { e.setAttribute("onclick", "") }) elegeta('div>small.pull-right', node).forEach(e => { e.style = "float:none !important"; e.parentNode.parentNode.appendChild(e); }); }, }, { 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: '360life.shinyusha.co.jp', urlRE: '//360life.shinyusha.co.jp/', listTitleXP: '//article/div[@class="m-article-item__info"]/h3[@class="m-article-item__title"]', listTitleSearchXP: '//article/div[@class="m-article-item__info"]/h3[@class="m-article-item__title"][***]/../../../..', listTitleMemoSearchXP: '//article/div[@class="m-article-item__info"]/h3[@class="m-article-item__title"][***]|//div[@class="article-header"]/h1[@class="article-header__title"][***]', listGen: 4, detailURLRE: /\/\/360life\.shinyusha\.co\.jp\/articles\//, detailTitleXP: '//div[@class="article-header"]/h1[@class="article-header__title"]', detailTitleSearchXP: '//div[@class="article-header"]/h1[@class="article-header__title"][***]/../../../../..', redoWhenReturned: 1, trim: 1, }, { 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', // youtube:: // helpOnDNI: 1, delayAutoWeighting: 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\?/, listTitleXPIgnoreNotExist: 1, 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"]|//div[2]/ytd-video-primary-info-renderer[@has-date-text=""]/div/h1/yt-formatted-string[@force-default-style="" and contains(@class,"style-scope ytd-video-primary-info-renderer")]|//ytd-watch-metadata[@class="style-scope ytd-watch-flexy"]/div/div[@class="style-scope ytd-watch-metadata"]/h1[@class="style-scope ytd-watch-metadata"]/yt-formatted-string', // listTitleSearchXP: '//ytd-grid-video-renderer[.//a[@id="video-title" and +++]]|//ytd-channel-name[@wrap-text=""]/div/div/yt-formatted-string[+++]/following::a|.//ytd-video-renderer[.//a[@id="video-title" and ++title++]]|.//ytd-video-renderer[.//a[contains(@class,"yt-simple-endpoint") and +++]]|.//ytd-rich-item-renderer[.//yt-formatted-string[@id="video-title" and +++]]|.//ytd-rich-item-renderer[.//a[contains(@class,"yt-simple-endpoint") and +++]]|.//ytd-playlist-video-renderer[.//a[@id="video-title" and ++title++]]', listTitleSearchXP: '//ytd-grid-video-renderer[.//a[@id="video-title" and +++]]|//ytd-channel-name[@wrap-text=""]/div/div/yt-formatted-string[+++]/following::a|.//ytd-video-renderer[.//a[@id="video-title" and ++title++]]|.//ytd-video-renderer[.//a[contains(@class,"yt-simple-endpoint") and +++]]|.//ytd-rich-item-renderer[.//yt-formatted-string[@id="video-title" and +++]]|.//ytd-rich-item-renderer[.//a[contains(@class,"yt-simple-endpoint") and +++]]|.//ytd-playlist-video-renderer[.//a[@id="video-title" and ++title++]]|.//yt-formatted-string[@id="video-title" and +++]/ancestor::div[@id="dismissible"]', 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"][+++]|//h1/yt-formatted-string[contains(@class,"style-scope ytd-video-primary-info-renderer")][+++]|//ytd-watch-metadata[@class="style-scope ytd-watch-flexy"]/div/div[@class="style-scope ytd-watch-metadata"]/h1[@class="style-scope ytd-watch-metadata"]/yt-formatted-string[+++]|//div/h1[@class="style-scope ytd-watch-metadata"]/yt-formatted-string[+++]|.//yt-formatted-string[@id="video-title" and +++]', // 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, keyFunc: [{ key: 'u', // u::チャプターメモ func: (e) => { chapterMemo(/watch/, '//div[2]/ytd-video-primary-info-renderer[@has-date-text=""]/div/h1/yt-formatted-string[@force-default-style="" and contains(@class,"style-scope ytd-video-primary-info-renderer")]|//ytd-watch-metadata[@class="style-scope ytd-watch-flexy"]/div/div[@class="style-scope ytd-watch-metadata"]/h1[@class="style-scope ytd-watch-metadata"]/yt-formatted-string', `https://www.youtube.com/watch?v=${location.href.match0(/v\=([^?&]*)/)}&t=**time**`) }, }, { key: 'Shift+U', // Shift+U::チャプターメモをクリップボードにコピー func: (e) => { //chapterMemo(/watch/, '//div[2]/ytd-video-primary-info-renderer[@has-date-text=""]/div/h1/yt-formatted-string[@force-default-style="" and contains(@class,"style-scope ytd-video-primary-info-renderer")]|//ytd-watch-metadata[@class="style-scope ytd-watch-flexy"]/div/div[@class="style-scope ytd-watch-metadata"]/h1[@class="style-scope ytd-watch-metadata"]/yt-formatted-string', `${(++kaisuuU%2?"https://www.youtube.com/watch?v=**id**1&t=**time**":"https://youtu.be/**id**?t=**time**").replace("**id**",location.href.match0(/v\=([^?&]*)/))}`, 1) chapterMemo(/watch/, '//div[2]/ytd-video-primary-info-renderer[@has-date-text=""]/div/h1/yt-formatted-string[@force-default-style="" and contains(@class,"style-scope ytd-video-primary-info-renderer")]|//ytd-watch-metadata[@class="style-scope ytd-watch-flexy"]/div/div[@class="style-scope ytd-watch-metadata"]/h1[@class="style-scope ytd-watch-metadata"]/yt-formatted-string', `${(++kaisuuU%2?"https://www.youtube.com/watch?v=**id**&t=**time**":"https://youtu.be/**id**?t=**time**").replace("**id**",location.href.match0(/v\=([a-zA-Z0-9_\-]{11})/))}`, 1) //kaisuuU=++kaisuuU }, }, { key: 'a', // a:: func: () => { if (/\/\/www.youtube.com\/channel\/[^\/]+\/videos/.test(location.href) || /\/\/www.youtube.com\/user\/[^\/]+\/videos/.test(location.href) || /\/\/www.youtube.com\/c\/[^\/]+\/videos/.test(location.href)) { var sorttype = Number($('.yhmSortType')?.attr("id") || 0); $('.yhmSortType').remove(); $(document.body).append(``) popup2("A:ソート\n" + (["時間長", "時間短", "タイトル", "再生多", "再生少", "古い", "新しい"].map((c, i) => " " + c + (i + 1 == sorttype ? " ←\n" : "\n")).join("")), 6, "min-width:6em;") //popup2("A:ソート\n" + (["時間長", "時間短", "タイトル", "再生多", "再生少"].map((c, i) => " " + c + (i + 1 == sorttype ? " ←\n" : "\n")).join("")), 6, "min-width:6em;") switch (sorttype) { case 1: domsort(eleget0('//ytd-item-section-renderer/div[3]/ytd-grid-renderer[@class="style-scope ytd-item-section-renderer"]/div[@id="items"]'), elegeta('//ytd-grid-video-renderer[@class="style-scope ytd-grid-renderer"]'), (v) => { return -Number(v?.querySelector('span.ytd-thumbnail-overlay-time-status-renderer')?.textContent?.replace(/[^0-9]/gmi, "")) }, 1); break; case 2: domsort(eleget0('//ytd-item-section-renderer/div[3]/ytd-grid-renderer[@class="style-scope ytd-item-section-renderer"]/div[@id="items"]'), elegeta('//ytd-grid-video-renderer[@class="style-scope ytd-grid-renderer"]'), (v) => { return Number(v?.querySelector('span.ytd-thumbnail-overlay-time-status-renderer')?.textContent?.replace(/[^0-9]/gmi, "")) }, 1); break; case 3: domsort(eleget0('//ytd-item-section-renderer/div[3]/ytd-grid-renderer[@class="style-scope ytd-item-section-renderer"]/div[@id="items"]'), elegeta('//ytd-grid-video-renderer[@class="style-scope ytd-grid-renderer"]'), (v) => v?.querySelector('a#video-title')?.title, 1); break; case 4: domsort(eleget0('//ytd-item-section-renderer/div[3]/ytd-grid-renderer[@class="style-scope ytd-item-section-renderer"]/div[@id="items"]'), elegeta('//ytd-grid-video-renderer[@class="style-scope ytd-grid-renderer"]'), (v) => { let n = v?.querySelector('#metadata-line>span:nth-child(1)')?.textContent; return -parseFloat(n) * (n.match0("万") ? 10000 : n.match0("億") ? 100000000 : 1) }, 1) break; case 5: domsort(eleget0('//ytd-item-section-renderer/div[3]/ytd-grid-renderer[@class="style-scope ytd-item-section-renderer"]/div[@id="items"]'), elegeta('//ytd-grid-video-renderer[@class="style-scope ytd-grid-renderer"]'), (v) => { let n = v?.querySelector('#metadata-line>span:nth-child(1)')?.textContent; return parseFloat(n) * (n.match0("万") ? 10000 : n.match0("億") ? 100000000 : 1) }, 1); break; // 不正確 case 6: domsort(eleget0('//ytd-item-section-renderer/div[3]/ytd-grid-renderer[@class="style-scope ytd-item-section-renderer"]/div[@id="items"]'), elegeta('//ytd-grid-video-renderer[@class="style-scope ytd-grid-renderer"]'), (v) => { let n = eleget0('//div[@class="style-scope ytd-grid-video-renderer"]/span[2]', v)?.textContent; return -parseFloat(n) * (n?.match0("時間") ? 0.0416 : n?.match0("分") ? 0.00025 : n?.match0("週間") ? 7 : n?.match0("か月") ? 31 : n?.match0("年") ? 365 : 1) }, 1) break; case 7: domsort(eleget0('//ytd-item-section-renderer/div[3]/ytd-grid-renderer[@class="style-scope ytd-item-section-renderer"]/div[@id="items"]'), elegeta('//ytd-grid-video-renderer[@class="style-scope ytd-grid-renderer"]'), (v) => { let n = eleget0('//div[@class="style-scope ytd-grid-video-renderer"]/span[2]', v)?.textContent; return parseFloat(n) * (n?.match0("時間") ? 0.0416 : n?.match0("分") ? 0.00025 : n?.match0("週間") ? 7 : n?.match0("か月") ? 31 : n?.match0("年") ? 365 : 1) }, 1) $('.yhmSortType').remove(); break; } return } if (/\/\/www.youtube.com\/results\?search_query=/.test(location.href)) { // 検索結果 var sorttype = Number($('.yhmSortType')?.attr("id") || 0); $('.yhmSortType').remove(); $(document.body).append(``) popup2("A:ソート\n" + (["時間長", "時間短", "タイトル", "再生多", "再生少", "古い", "新しい", "投稿者"].map((c, i) => " " + c + (i + 1 == sorttype ? " ←\n" : "\n")).join("")), 6, "min-width:6em;") switch (sorttype) { case 1: domsort(eleget0('div#contents.style-scope.ytd-item-section-renderer'), elegeta('ytd-video-renderer.style-scope.ytd-item-section-renderer'), (v) => { return -Number(eleget0('//span[@id="text" and @class="style-scope ytd-thumbnail-overlay-time-status-renderer"]', v)?.textContent?.replace(/[^0-9]/gmi, "")) }, 1); break; case 2: domsort(eleget0('div#contents.style-scope.ytd-item-section-renderer'), elegeta('ytd-video-renderer.style-scope.ytd-item-section-renderer'), (v) => { return Number(eleget0('//span[@id="text" and @class="style-scope ytd-thumbnail-overlay-time-status-renderer"]', v)?.textContent?.replace(/[^0-9]/gmi, "")) }, 1); break; case 3: domsort(eleget0('div#contents.style-scope.ytd-item-section-renderer'), elegeta('ytd-video-renderer.style-scope.ytd-item-section-renderer'), (v) => eleget0('//yt-formatted-string[@class="style-scope ytd-video-renderer"]', v)?.textContent, 1); break; case 4: domsort(eleget0('div#contents.style-scope.ytd-item-section-renderer'), elegeta('ytd-video-renderer.style-scope.ytd-item-section-renderer'), (v) => { let n = eleget0('//span[@class="style-scope ytd-video-meta-block"]', v)?.textContent; return -parseFloat(n) * (n.match0("万") ? 10000 : n.match0("億") ? 100000000 : 1) }, 1) break; case 5: domsort(eleget0('div#contents.style-scope.ytd-item-section-renderer'), elegeta('ytd-video-renderer.style-scope.ytd-item-section-renderer'), (v) => { let n = eleget0('//span[@class="style-scope ytd-video-meta-block"]', v)?.textContent; return parseFloat(n) * (n.match0("万") ? 10000 : n.match0("億") ? 100000000 : 1) }, 1) break; case 6: domsort(eleget0('div#contents.style-scope.ytd-item-section-renderer'), elegeta('ytd-video-renderer.style-scope.ytd-item-section-renderer'), (v) => { let n = eleget0('//div[@class="style-scope ytd-video-meta-block"]/div/span[2]', v)?.textContent; return -parseFloat(n) * (n?.match0("時間") ? 0.0416 : n?.match0("分") ? 0.00025 : n?.match0("週間") ? 7 : n?.match0("か月") ? 31 : n?.match0("年") ? 365 : 1) }, 1) break; case 7: domsort(eleget0('div#contents.style-scope.ytd-item-section-renderer'), elegeta('ytd-video-renderer.style-scope.ytd-item-section-renderer'), (v) => { let n = eleget0('//div[@class="style-scope ytd-video-meta-block"]/div/span[2]', v)?.textContent; return parseFloat(n) * (n?.match0("時間") ? 0.0416 : n?.match0("分") ? 0.00025 : n?.match0("週間") ? 7 : n?.match0("か月") ? 31 : n?.match0("年") ? 365 : 1) }, 1) break; case 8: domsort(eleget0('div#contents.style-scope.ytd-item-section-renderer'), elegeta('ytd-video-renderer.style-scope.ytd-item-section-renderer'), (v) => eleget0('//a[@class="yt-simple-endpoint style-scope yt-formatted-string"]', v)?.textContent, 1); $('.yhmSortType').remove(); break; } return } }, }], //WhateverFirstAndEveryAPFunc: () => {if((/\/\/www.youtube.com\/results\?search_query=/.test(location.href)) || (/\/\/www.youtube.com\/channel\/[^\/]+\/videos/.test(location.href) || /\/\/www.youtube.com\/user\/[^\/]+\/videos/.test(location.href))) popup3(`A:ソート`,8,5000)}, wholeHelp: [() => (/\/\/www.youtube.com\/results\?search_query=/.test(location.href)) || (/\/\/www.youtube.com\/channel\/[^\/]+\/videos/.test(location.href) || /\/\/www.youtube.com\/user\/[^\/]+\/videos/.test(location.href)), " A:ソート"], }, { 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++]|.//div[@itemprop="name" and @id="name" and ***]|.//div/div[@id="name" and ***]', listGen: 3, detailURLRE: /iherb.com\/pr\//, detailTitleXP: '//div[@itemprop="name" and @id="name"]', detailTitleSearchXP: '//div[@itemprop="name" and @id="name"][***]/../../../../..', trim: 1, titleProcessFunc: (title) => { return title.replace(/
/gmi, "") }, func: () => { elegeta('//div[@itemprop="name" and @id="name"]').forEach(e => e.textContent = e.textContent.replace(/\&/gmi, "&").replace(/\"/gmi, "”").trim()) // &はxpath/textで見逃す elegeta('//div[@class="absolute-link-wrapper"]/a').forEach(e => e.title = e.title.replace(/\&/gmi, "&").replace(/\"/gmi, "”").trim()) 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)); } if ((cat.some(e => /食品/.test(e.innerText)))) { [/(食物繊維\D{0,9}[0-9.]+[gg])/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(' 統計').append(' フィードバック')}) }, }, { 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, keyFunc: [{ key: 'Shift+F', // Shift+F::refind2chでキーワード検索 func: () => { searchWithHistory("REFIND2CH", "re.Find2ch", 'https://refind2ch.org/search?q=***&sort=rate', " OR ") }, }], }, { // 5chスレッド内 id: `${/shitaraba\.net/.test(location.href)?"SHITARABA":"5CH"}`, //'5CH', urlRE: '.5ch.net/test/read.cgi/|.shitaraba.net/bbs/read.cgi/|.shitaraba.net/bbs/read_archive.cgi/', listTitleXP2: '//span[@class="uid"]', listTitleXPIgnoreNotExist: 1, forceRunIffunc: () => { return /\.shitaraba\.net\/bbs\/read\.cgi\//.test(location.href) || eleget0('.thread > dd:nth-child(2)') }, // titleProcessFunc: (title) => { return title.replace(/\>\>.*$/, "").replace(/ |\s|:/g, "").trim() }, // titleProcessFunc: (title) => { return title.replace(/\>\>.*$/, "").trim() }, // titleProcessFunc: (title) => { return /^\d{1,4}.+\d\d\d\d\/\d\d\/\d\d\(.\)\s\d\d\:/.test(title) ? title.replace(/\>\>.*$/, "").replace(/ |\s|:/g, "").trim() : title.replace(/\>\>.*$/, "").trim() }, hideSelectedWord: 1, // selectedHelp: { help: [KEYHIDE + ":NGワードに追加"], multi: "複数行に渡る文字列は NG に入れられません" }, selectedHelp: { help: [KEYHIDE + ":NGワードに追加"] }, //, multi: "複数行に渡る文字列は NG に入れられません" }, // titleProcessFunc: (title) => { return /^\d{1,4}.+\d\d\d\d\/\d\d\/\d\d\(.\)\s\d\d\:/.test(title.replace(/\n/gm, "").trim()) ? title.replace(/\>\>.*$/, "").replace(/\n| |\s|:/g, "").trim() : title.replace(/\n/gm, "").replace(/\>\>.*$/, "").trim() }, titleProcessFunc: (title) => { return /^\d{1,4}.+\d\d\d\d\/\d\d\/\d\d\(.\)\s..\:/.test(title.replace(/\n/gm, "").trim()) ? title.replace(/\>\>.*$/, "").replace(/\n| |\s|:/g, "").trim() : title.replace(/\n/gm, "").replace(/\>\>.*$/, "").trim() }, XP2name: 'ID ', // id: '5CH', // urlRE: '.5ch.net/test/read.cgi/', listTitleXP: '//div[@class="meta"]', // 項目名はレス番~IDまでの一連のdiv.meta listTitleSearchXP: '//div[@class="meta"][**alt**]/..|//span[@class="escaped"][***]/../..', listTitleMemoSearchXP: '//div[@class="meta"][**alt**]/span[@class="date"]', // listHelpXP: '//div/div[@class="post"]', listHelpXP: '//div[@class="post"]', listGen: 6, searchAllowLength: 1, // delay: 100, //delayAutoWeighting: 0.6, // 5chサムネイル表示他のhNukiURLHokan()より後でないとメモを消せなくなる delay: 100, //delayAutoWeighting: 0.6, // 5chサムネイル表示他のhNukiURLHokan()より後でないとメモを消せなくなる keyFunc: [{ key: 'Shift+F', // Shift+F::refind2chでキーワード検索 func: () => { searchWithHistory("REFIND2CH", "re.Find2ch", 'https://refind2ch.org/search?q=***&sort=rate', " OR ") }, }, { key: 'a', // a:: func: () => { var sorttype = Number($('.yhmSortType')?.attr("id") || 0); $('.yhmSortType').remove(); $(document.body).append(``) popup2("A:ソート\n" + (["引用", "リンク", "古い順"].map((c, i) => " " + c + (i + 1 == sorttype ? " ←\n" : "\n")).join("")), 6, "min-width:6em;") $(".thread>br,#thread-body>br").remove() switch (sorttype) { case 1: domsort(eleget0('.thread,#thread-body'), elegeta('.post'), v => { return -(v.querySelectorAll('.allpopup').length) }, 1) break; case 2: domsort(eleget0('.thread,#thread-body'), elegeta('.post'), v => { return Number((v?.textContent?.match(/ttps?:\/\//gmi)?.length)) && -1 - Number((v.querySelectorAll('.allpopup').length)) || 0 }, 1) //domsort(eleget0('.thread,#thread-body'), elegeta('.post'), v => { return Number((v?.textContent?.match(/ttps?:\/\//gmi)?.length)) && -Number((v?.textContent?.match(/ttps?:\/\//gmi)?.length))*1000 - Number((v.querySelectorAll('.allpopup').length)) || 0 },1) break; case 3: domsort(eleget0('.thread,#thread-body'), elegeta('.post'), v => { return (v.id) }, 1) $('.yhmSortType').remove(); break; } $('.post').after("
") } }], wholeHelp: [() => 1, " A:ソート"], listTitleSearchFunc: (title) => { // レス中キーワードNG let resHit = []; if (typeof title === "string" && /\D/m.test(title)) { // textContentでサーチする // for (let res of elegeta('//div[@class="message"]')) { // レス本文 for (let res of elegeta('.message')) { // レス本文 if (res.textContent.indexOf(title) !== -1) resHit.push(res.parentNode); } // for (let res of elegeta('//span[@class="uid"]')) { // ID for (let res of elegeta('.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: () => { GM_addStyle('.uid:hover{background:#ddeeffc0; border: 0px solid #ddeeffc0; color: #000000; text-shadow: 0 0 4px #ddeeffc0; box-shadow: inset 0 0 6px #ddeeffc0, 0 0 6px #ddeeffc0; }') // 旧表示なら対応するために加工 if (/\.shitaraba\.net\/bbs\/read\.cgi\/|\.shitaraba\.net\/bbs\/read_archive.cgi\//.test(location.href)) $('dl.rep-comment:hidden').remove(); // したらばでは本家の>>1等のアンカーの中に見えないHTMLのコピーがありQ等がそれに反応してしまうので消す if (/\.5ch\.net\/test\/read\.cgi\/|\.shitaraba\.net\/bbs\/read\.cgi\/|\.shitaraba\.net\/bbs\/read_archive.cgi\//.test(location.href) && eleget0("//div/dl/dt|//body/dl/dt")) { if (/\.shitaraba\.net\/bbs\/read/.test(location.href) && eleget0("//div/dl/dt|//body/dl/dt")) { $('dl>br').remove() } elegeta('.thread dd').forEach(e => elegeta('br', e)?.pop()?.remove()) // 本文末尾の空改行をtrim var res1 = elegeta("//div/dl/dt|//body/dl/dt").slice(0, 1001) var res2 = elegeta("//div/dl/dd|//body/dl/dd").slice(0, 1001) if (res1.length && res1.length == res2.length) { GM_addStyle('div.post{border-width: 1px; display: inline-block; border-style: none solid solid none; border-color: #ddd; background-color: #efefef; margin-bottom: 8px; padding: 8px;}div.meta { margin: 0 0 0.33em; } .message { font-size: 17px; color: #333; padding: 2px 0 10px; overflow-wrap: break-word; }') 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 (/
[\s]{0,22}\<\/dd\>/.test(res2o)) res2o = res2o.replace(/
[\s]{0,22}\<\/dd\>/, ""); // 後ろの空改行をtrim e.outerHTML = `
`; res2[i].remove(); }); } elegeta('//div[@class="post"]/div[1]/span[@class="date"]').slice(0, 1001).forEach(e => { e.closest(".post").id = e.textContent.trim().match0(/^\d+/) || null; }) } }, func: () => { for (let e of elegeta('//div[@class="meta"][not(@alt)]').slice(0, 1001)) { // レスの特定のために1行目をまとめてtitle属性に埋める let id = e.innerText.replace(/>>.*/g, "").replace(/ |\s|:/g, "").trim(); e.setAttribute("alt", 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 + ' キー:\n『' + selectedStr + '』\nを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/|//www.nicovideo.jp/watch/', listTitleXP: '//div/p[@class="itemTitle"]/a|//div/div[@class="HeaderContainer-topAreaLeft"]/h1[@class="VideoTitle"]', listTitleSearchXP: '//div/p[@class="itemTitle"]/a[++title++]/../../..', listTitleMemoSearchXP: '//div/p[@class="itemTitle"]/a[++title++]|//div/div[@class="HeaderContainer-topAreaLeft"]/h1[@class="VideoTitle"][+++]/..', listGen: 7, detailURLRE: /\/watch\//, detailTitleXP: '//div/div[@class="HeaderContainer-topAreaLeft"]/h1[@class="VideoTitle"]', detailTitleSearchXP: '//div/div[@class="HeaderContainer-topAreaLeft"]/h1[@class="VideoTitle"][+++]', keyFunc: [{ key: 'u', // u::チャプターメモ func: (e) => { chapterMemo(/watch/, '//div/div[@class="HeaderContainer-topAreaLeft"]/h1[@class="VideoTitle"]', `https://www.nicovideo.jp/watch/${(location.href.match0(/\/watch\/([^/?]+)/))}?from=**time**`) }, }, { key: 'Shift+U', // Shift+U::チャプターメモをクリップボードにコピー func: (e) => { chapterMemo(/watch/, '//div/div[@class="HeaderContainer-topAreaLeft"]/h1[@class="VideoTitle"]', `https://www.nicovideo.jp/watch/${(location.href.match0(/\/watch\/([^/?]+)/))}?from=**time**`, 1) }, }], funcOnlyFirst: () => { document.addEventListener('fullscreenchange', (event) => { if (document.fullscreenElement && $('video')[0] && $('video')[0].paused == false) { $("#yafuokuhelp").hide(200) } else { $("#yafuokuhelp").show(300) } }) 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; run(document.body, "returned") }, 3500); } }); observeUrlHasChanged.observe(document, { childList: true, subtree: true }); }, // 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: '//p[@class="book-item__title"]', listTitleSearchXP: '//p[@class="book-item__title"][***]/../..', listTitleMemoSearchXP: '//p[@class="book-item__title"][***]', //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, "").replace(/\.\.\./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: [() => 1, " " + 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"]|//h1[@id="title"]/span[@id="productTitle"]|.//h2/a/span[contains(@class,"a-size-base a-color-base a-text-normal")]|.//span[contains(@class,"a-size-medium a-color-base a-text-normal")]', //listTitleSearchXP: '//div[@data-asin and .//span[@class="a-size-base a-color-base a-text-normal" and ***]]|.//div[@data-asin and .//span[contains(@class,"a-size-medium a-color-base a-text-normal") and ***]]', listTitleSearchXP: '//div[@data-asin and .//span[@class="a-size-base-plus a-color-base a-text-normal" and ***]]|.//div[@data-asin and .//span[contains(@class,"a-size-medium a-color-base a-text-normal") and ***]]', listTitleMemoSearchXP: '//div[contains(@class,"s-title-instructions-style")]/h2/a/span[***]/..|//h1[@class="a-size-large a-spacing-none"]/span[@id="productTitle"][***]/..', 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: '//div[@data-asin][.//span[@class="a-size-base a-color-base a-text-normal"]]|.//div[@data-asin][.//span[contains(@class,"a-size-medium a-color-base a-text-normal")]]', 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, observeClassNameNot: ["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"]|//div/div[@data-category="musical-instruments"]/a[1]')) { [/([\d\s\,]+mAh)/m, /([\d\s\,]+mAh)/m, /([\d\s\,]{2,9}回)/m, /(感度.{1,20}dB)/mi].forEach(m => autoMemo(m)); // [/([\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)); } if (eleget0('//div[@id="nav-subnav" and @data-category="food-beverage"]')) { [/(食物繊維\D{0,9}[0-9.]+[gg])/m].forEach(m => autoMemo(m)); } if (eleget0('//div/a/span/img[@alt="AMAZON FASHION"]|//span[@class="nav-a-content" and contains(text(),"産業・研究開発用品")]')) { [/(ハイパーV)|(Hyper.?V)|(.?先芯.{0,3})/mi].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の一部(正規表現) necessaryToWorkFunc: null, // この関数がありfalseなら動作を停止する 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, // 処理時にそのサイトでのみ実行したい関数があれば書く funcQ: null, // Qキー処理時にそのサイトでのみ実行したい関数があれば書く funcMemo: null, // 5/6などメモ関係処理時にそのサイトでのみ実行したい関数があれば書く funcFinally: null, // そのサイトで非表示やメモの処理が終わった後に実行したい関数があれば書く titleProcessFunc: null, // 項目名を保存する前に加工したければ関数を書く autoTranslucentURLRE: //, // 強制的に半透明モードにするURLの正規表現 Web漫画アンテナのマイリスト等 listTitleXPIgnoreNotExist: 0, // 通常listTitleXPにヒットする要素が1つもなくobserveも0なら動作を停止するがこれがtrueだと停止をしない 項目が動的に追加されるページなどで使用 forceRunIffunc: null, // これがありtrueを返したらlistTitleXPIgnoreNotExist=1と同様に動作の停止をしない 項目が動的に追加されるページ、先に加工を要するページ(旧5ch)などで使用 delay: 0, // ミリ秒 ページ読み込み後処理を開始するまでの遅延 delayAutoWeighting: 0, // 0以外ならページ開始時から処理開始までの遅延の係数(省略可) delayと排他利用 observe: 0, // ミリ秒 1以上だと要素追加ごとにこのミリ秒の遅延を置いて再処理する(とても遅い) 項目が動的に追加されるページなどで使用 observeId: "", // これがあるとobserve有効時にこのIDの要素でないものは無視する YouTubeなどの高速化に重要 observeClass: [], // これがあるとobserve有効時にこれに含まれるClassNameでない要素は無視する futapoなどの高速化に重要 observeClassNameNot:[], // これがあると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時に実行する関数 memoStyle:"", // メモのstyle=""指定に特別に追加する文字列 }, */ ]; 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; if (!(/\*\*\*|\*\*title\*\*|\*\*alt\*\*/.test(SITE.detailTitleSearchXP || "") || /\*\*\*|\*\*title\*\*|\*\*alt\*\*/.test((SITE.listTitleSearchXP || "") || /\*\*\*|\*\*title\*\*|\*\*alt\*\*/.test(SITE.listlTitleMemoSearchXP || "")))) 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{all:initial; word-wrap:break-word;cursor:pointer; font-size:14px; 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 + "\n" + memo, 0); 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.id == "5CH") { var oldmemo = pref(SITE.id + ' : SearchMyMemo') var newmemo = JSON.parse(JSON.stringify(oldmemo)) newmemo.forEach(c => { c.t = c.t.replace(document.title, "").replace(/ |\s|:/g, "").trim() }) //prompt("",JSON.stringify(oldmemo) );prompt("", JSON.stringify(newmemo)) if (JSON.stringify(oldmemo) != JSON.stringify(newmemo)) { pref(SITE.id + ' : SearchMyMemo', newmemo) alert("前バージョンからのメモの変換に成功しました") //JSON.stringify(newmemo)) } } // if (SITE.funcOnlyFirst) SITE.funcOnlyFirst(); // if (SITE.WhateverFirstAndEveryAPFunc) { // SITE.WhateverFirstAndEveryAPFunc(); if (SITE.funcOnlyFirst) setTimeout(() => { SITE.funcOnlyFirst(); }, (SITE.delayAutoWeighting || 0) * WAIT || (SITE.delay || 0)); if (SITE.WhateverFirstAndEveryAPFunc) { setTimeout(() => { SITE.WhateverFirstAndEveryAPFunc(); }, (SITE.delayAutoWeighting || 0) * WAIT || (SITE.delay || 0)); document.body.addEventListener('AutoPagerize_DOMNodeInserted', function(evt) { SITE.WhateverFirstAndEveryAPFunc(evt.target); }, false); } if (SITE.keyFunc) { // SITEINFOにあるkeyFunc document.addEventListener('keydown', e => { if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.getAttribute('contenteditable') === 'true' || ((e.target.closest('#chat-messages,ytd-comments-header-renderer') || document.activeElement.closest('#chat-messages,ytd-comments-header-renderer')))) return; var key = (e.shiftKey ? "Shift+" : "") + (e.altKey ? "Alt+" : "") + (e.ctrlKey ? "Ctrl+" : "") + e.key; //if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA' && e.target.getAttribute('contenteditable') != 'true') { //if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.getAttribute('contenteditable') === 'true' || (inYOUTUBE && (document.activeElement.closest('#chat-messages') || document.activeElement.closest('ytd-comments-header-renderer')))) return; SITE.keyFunc.forEach(c => { // if (key == c.key) { c.func(key) } // if (key.match0(c.key)) { c.func(key) } if (typeof c.key === "string" ? key === c.key : key.match0(c.key)) { c.func(key) } }) //} }, 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; if (debug) dc("isDetail : " + isDetail) var isHidePartialMatch = (SITE.listTitleSearchXP && SITE.listTitleSearchXP.indexOf("**") != -1) ? 1 : 0; var isMemoPartialMatch = (SITE.listTitleMemoSearchXP && SITE.listTitleMemoSearchXP.indexOf("**") != -1) ? 1 : 0; // ヤフオク上限価格は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) && !(SITE.forceRunIffunc && SITE.forceRunIffunc())) { if ((SITE.listTitleXPIgnoreNotExist) || (SITE.observe) || (SITE.forceRunIffunc && SITE.forceRunIffunc())) {} else { if (debug) popup3("対象要素がないのでこのページでは働きません"); return; } } if (SITE.necessaryToWork && (document.body.innerText.match(SITE.necessaryToWork)) == null) { //prompt(document.body.innerText,document.body.innerText.match(SITE.necessaryToWork)) if (debug) popup3("非対応ページなのでこのページでは働きません"); return; } if (SITE.selectedHelp) { $('body').on('mouseup', function(e) { var selectedStr; if (window.getSelection) { selectedStr = window.getSelection().toString(); if (selectedStr !== '' && selectedStr !== '\n') { if (selectedStr.indexOf("\n") !== -1) SITE.selectedHelp.multi ? popup3(SITE.selectedHelp.multi, 12, 5000) : 0; else SITE.selectedHelp.help ? popup3(`『${selectedStr}』を\n` + SITE.selectedHelp.help.join("\n"), 12, 5000) : 0; } } }); } 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(/\*\*alt\*\*/g, "contains(@alt,\"" + title + "\")").replace(/\*\*title\*\*/g, "contains(@title,\"" + title + "\")").replace(/\+\+title\+\+/g, "@title=\"" + title + "\"").replace(/\+\+url\+\+/g, "@href=\"" + title + "\"").replace(/\*\*url\*\*/g, "contains(@href,\"" + title + "\")"); }; 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' || ((e.target.closest('#chat-messages,ytd-comments-header-renderer') || document.activeElement.closest('#chat-messages,ytd-comments-header-renderer')))) return; //if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA' || e.target.getAttribute('contenteditable') === 'true' || (inYOUTUBE && (document.activeElement.closest('#chat-messages') || document.activeElement.closest('ytd-comments-header-renderer')))) return; 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; } } if (SITE.listTitleXP2) { // 2つ目の項目名がありそこにホバーしていればそれで非表示登録 var ele = document.elementFromPoint(mousex, mousey); if (elegeta(SITE.listTitleXP2).indexOf(ele) != -1) { // hideByTitle(ele.innerText, SITE.listTitleXP2); hideByTitle(ele.innerText); addNG(ele.innerText); if (SITE.funcQ) SITE.funcQ(); 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); if (debug) 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] || ""; title2 = title2 ? ("。次のアンドゥ対象は\n『" + title2 + "』") : "" pref(SITE.id + ' : SearchHideTitle', resist) || []; showByTitle(title); if (isDetail && SITE.showFunc) SITE.showFunc(); if (title) popup2("『" + title + "』\nを非表示登録から削除しました" + 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 == 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; key = KEYMEMO5 } else { MEMO6WORD = memo; key = KEYMEMO6 } if (SITE.funcMemo) SITE.funcMemo(); if (memo == false) 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); if (SITE.funcMemo) SITE.funcMemo(); 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 == 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); if (SITE.funcMemo) SITE.funcMemo(); 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); if (SITE.funcMemo) SITE.funcMemo(); 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); if (SITE.funcMemo) SITE.funcMemo(); return false; } if ((key == KEYMEMO1S || key == KEYMEMO2S)) { // 3:: 4:: free memo e.preventDefault(); var target = (prompt(`メモを付けたい項目のタイトルが含むキーワードを入力してください\nこのページでは${SITE.listTitleMemoSearchXP.indexOf("**")!=-1?"部分一致です":"全体一致です"}\n\n`) || "").trim(); if (!target) return; var memo = (prompt("『" + target + "』\nに付けるメモを書いてください") || "").trim(); if (!memo) return; storeMemo(target.trim(), memo, key == KEYMEMO1S ? COLOR1 : COLOR2) if (SITE.funcMemo) SITE.funcMemo(); 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\n" + smm, smm); if (tmp !== null) { // ESCで抜けたのでなければ //pref(SITE.id + ' : SearchMyMemo', tmp.trim() || []); pref(SITE.id + ' : SearchMyMemo', tmp.trim() || []); prefRestrict(SITE.id + 'SearchMyMemo', "array"); var a = pref(SITE.id + ' : SearchMyMemo') var b = (Array.from(new Set(a.map(v => JSON.stringify(v))))).map(v => JSON.parse(v)) // uniq:オブジェクトの配列→JSON文字列配列→uniq→オブジェクトの配列 //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(); setTimeout(() => { location.reload(); }, 1000) return false } if (SITE.funcMemo) SITE.funcMemo(); return false; } if (key == KEYRESETMEMOAUTO) { // Shift+2::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+3::#::hide/show memo e.preventDefault(); if ($('#pickbox:visible,.setSlider:visible,[floated]:visible').length) { $('#pickbox:visible,.setSlider:visible,[floated]:visible').hide(); } else if ($(`.yhmMyMemo:visible,.ignoreMe.shibo:visible,#shiboButton:visible,#5chVerticalThreadTitle:visible,.setSlider:visible,#ftxa:visible`).length) { $(`.yhmMyMemo:visible,.ignoreMe.shibo:visible,#shiboButton:visible,#5chVerticalThreadTitle:visible,.setSlider:visible,#ftxa:visible`).hide() } else { $(`.yhmMyMemo:hidden,.ignoreMe.shibo:hidden,#shiboButton:hidden,#5chVerticalThreadTitle:hidden,.setSlider:hidden,#ftxa:hidden`).show() $('#pickbox:hidden,.setSlider:hidden,[floated]:hidden').show() } if (SITE.funcMemo) SITE.funcMemo(); 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; hovertimer = 0; }, 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) { if (debug) 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.observeId && (ele.id !== SITE.observeId)) return; if (SITE.observeClass && !SITE.observeClass.includes(e.target.className)) return; if (ele.classList && ele.classList.contains("ignoreMe")) return; if (SITE.observeTagName && SITE.observeTagName !== ele.tagName) return; if (ele.className && SITE.observeClassNameNot && SITE.observeClassNameNot.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); //if(debug)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 // if(debug)dc("runmode : " + runmode + " / node tag: " + node?.tagName + " / ele.tag : " + ele?.tagName + " / ele.class : " + ele?.className + " ele.id : " + ele?.id); // beautify if (debug) 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) ? $("Q:非表示 W:アンドゥ 1:○メモ 2:×メモ") : $("Q:非表示 W:アンドゥ 1:○メモ 2:×メモ"); var lh2 = $(`${SITE.XP2name||""}Q:非表示 W:アンドゥ${ SITE.XP2memo?" 1:○メモ 2:×メモ":""}`); // 画面全体=詳細画面の方 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() { $('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() { $('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\*\*|\+\+alt\+\+|\+\+title\+\+|\+\+url\+\+|\*\*url\*\*/.test(SITE.listTitleSearchXP + " " + SITE.detailTitleSearchXP + " " + SITE.listTitleMemoSearchXP)) && !SITE.listTitleSearchFunc; //let fastmode = !fasttest ? null : !(/\*\*alt\*\*|\+\+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(fastmode ? "use fast test" : "NOT fast mode") 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 + ":アンドゥ " + (isHidePartialMatch ? (SITE.disableKeyB ? "" : KEYBW + ":NGワード ") : "") + KEYEDIT + ":NG編集 " + KEYMEMO1 + KEYMEMO2 + ":メモを追加 " + KEYMEMO1S + KEYMEMO2S + ":自由メモ " + KEYMEMO5 + KEYMEMO6 + ":定型メモ " + KEYRESETMEMO + ":メモを編集 " + (SITE.automemoURLRE ? KEYRESETMEMOAUTO + ":自動メモのみ全削除 " : "") + KEYTOGGLEtranslucent + ":半透明") + ((SITE.wholeHelp && SITE.wholeHelp[0]() && SITE.wholeHelp[1]) || ""); 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 + "個を非表示にしました\n" + help + (debug && fasttest ? " \n\nドラフトでマッチ:" + (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 (debug || (ENABLE_HELP_CONCLUSION && (SITE.helpOnDNI || (runmode === "1st" && SITE.listTitleXP)) && !(SITE.disableUrlRE && (location.href.match(SITE.disableUrlRE))))) popup2(help, 1.5); // 自動メモを探索&製作 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 (SITE.funcFinally) SITE.funcFinally(); return; } function restoreTranslucent() { if (pref(SITE.id + ' : SearchHideTitle')) { let fastmode = !fasttest ? null : !(/\*\*alt\*\*|\+\+alt\+\+|\+\+title\+\+|\+\+url\+\+|\*\*url\*\*/.test(SITE.listTitleSearchXP + " " + SITE.detailTitleSearchXP + " " + SITE.listTitleMemoSearchXP)) && !SITE.listTitleSearchFunc; 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; if (debug) 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.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,"$1"); 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, 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) if (debug) 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) if (debug) dc("go up (" + i + ") : " + ele.innerText) var ele2 = elegeta(SITE.listTitleXP, ele); if (!nodisplay) if (debug) dc("length:" + ele2.length) if (ele2.length === 1 || (SITE.searchAllowLength && ele2.length)) { if (!nodisplay) if (debug) 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); let isChapterMemo = color === COLORVIDEOTIME && /\/watch/.test(location.href); // && memo.match0(/^([\d:]+)\s/) 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); var ele = SITE.listTitleMemoSearchXPSameGen ? titleEle : titleEle.parentNode let isCPU = memo.match(/Pentium|Celeron|Core\s?i\d|Ryzen|GHz|AMD.*APU/i); // ele.innerHTML = '/g, ">").replace(/\n/gm, "
") + '』についたメモ(クリックで削除)' + (isCPU ? "\n\n右クリックでuserbenchmark検索\nhttps://duckduckgo.com/?q=!ducky+" + memo.replace(/[\u30a0-\u30ff\u3040-\u309f\u3005-\u3006\u30e0-\u9fcf\s]+/g, "+") + "+userbenchmark" : "") + (isChapterMemo ? "\n右クリックでこの位置から再生" : "") + '" style="' + MEMOSTYLE + (isCPU ? " cursor:help; " : "") + ' background-color:' + color + ';">' + memo + ''; ele.insertAdjacentHTML("afterend", '/g, ">").replace(/\n/gm, "
") + '』についたメモ(クリックで削除)' + (isCPU ? "\n\n右クリックでuserbenchmark検索\nhttps://duckduckgo.com/?q=!ducky+" + memo.replace(/[\u30a0-\u30ff\u3040-\u309f\u3005-\u3006\u30e0-\u9fcf\s]+/g, "+") + "+userbenchmark" : "") + (isChapterMemo ? "\n右クリックでこの位置から再生\nShift+Uで再生位置の列挙をコピー" : "") + '" style="' + MEMOSTYLE + (isCPU ? " cursor:help; " : "") + ' background-color:' + color + ';">' + memo + '') ele = ele.nextElementSibling $(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)); } // チャプターメモメモを右クリックでその場所に移動 u:: if (isChapterMemo && /\/watch/.test(location.href)) { $(ele).appendTo($(ele)).on('contextmenu', (function(title, memo) { return function() { var videoEle = eleget0('//video'); if (!videoEle) return videoEle.currentTime = hms2sec(memo.match0(/^([\d:]+)\s/)) || videoEle.currentTime //videoEle.scrollIntoView({ block: "center", behavior: "smooth" }) 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[contains(@class,"ignoreMe yhmMyMemo ' + escape(title + memo + color) + '")]')) $(e).hide(200).queue(function() { $(this.parentNode).remove() }); //e.remove(); //ele.remove(); for (let e of elegeta('//span[contains(@class,"yhmMyMemo") and @id="' + escape(title + memo + color) + '"]')) $(e).hide(200).queue(function() { $(this.parentNode).remove() }); //e.remove(); //ele.remove(); e.preventDefault(); e.stopPropagation(); }; */ $(ele).on("click", 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[contains(@class,"yhmMyMemo") and @id="' + 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); if (debug) 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(17); 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; elegeta('//*[text()="' + titleOrEle + '"]').forEach(e => { debugEle(e, "autoRemove") }); if (!ele.title && typeof titleOrEle === "string") { ele.title = `非表示登録『${titleOrEle}』にヒット` } } } } if (isDetail) { // 詳細:画面全体 if (isDetail && SITE.detailTitleXP && SITE.detailTitleSearchXP) { var xp = SITE.detailTitleSearchXP.replaceTitle(titleOrEle) // isearでハイライトされていると× for (let ele of elegeta(xp, node)) { if (debug) dc(xp, ele, ele.textContent); i++; ele.style.opacity = "0.5"; } } } return i; } function showByTitle(titleOrEle, time = 34, xpath = SITE.listTitleSearchXP) { if (!xpath) return 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現在の全体\n" + JSON.stringify(pref(SITE.id + ' : SearchHideTitle') || []) + "\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 + "』\nを非表示登録から削除しました", 1); showByTitle(title); if (isDetail && SITE.showFunc) SITE.showFunc(); } else { resist.push(title); pref(SITE.id + ' : SearchHideTitle', resist); popup2("『" + title + "』\nを非表示登録しました(" + 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 || !node) return []; let flag if (!/^\.?\//.test(xpath)) return /:visible$/.test(xpath) ? [...node.querySelectorAll(xpath.replace(/:visible$/, ""))].filter(e => e.offsetHeight) : [...node.querySelectorAll(xpath)] try { var array = []; var ele = document.evaluate("." + xpath.replace(/:visible$/, ""), node, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); let l = ele.snapshotLength; for (var i = 0; i < l; i++) array[i] = ele.snapshotItem(i); return /:visible$/.test(xpath) ? array.filter(e => e.offsetHeight) : array; } catch (e) { popup3(e + "\n" + xpath + "\n" + JSON.stringify(node), 1); return []; } } function eleget0(xpath, node = document) { if (!xpath || !node) return null; if (!/^\.?\//.test(xpath)) return node.querySelector(xpath.replace(/:visible$/, "")); try { var ele = document.evaluate("." + xpath.replace(/:visible$/, ""), node, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); // return ele.snapshotLength > 0 ? ele.snapshotItem(0) : ""; return ele.snapshotLength > 0 ? ele.snapshotItem(0) : null; } catch (e) { popup3(e + "\n" + xpath + "\n" + JSON.stringify(node), 1); return null; } } /* function elegeta(xpath, node = document) { if (!xpath) return []; if (!/^\.?\/\//.test(xpath)) return [...node.querySelectorAll(xpath)]; // // 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.UNORDERED_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 + "\n" + xpath, 1); return []; } } function eleget0(xpath, node = document) { if (!xpath) return null; if (!/^\.?\/\//.test(xpath)) return node.querySelector(xpath); try { var ele = document.evaluate("." + xpath, node, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); return ele.snapshotLength > 0 ? ele.snapshotItem(0) : ""; } catch (e) { popup2(e + "\n" + xpath, 1); return null; } } */ function dc(str, force = 0) { //if (debug == 1) console.log(str); if (debug >= 1 || force) popup3(str, 0, 5000, "top"); return str; } function popup3(text, i = 0, timer = 15000, alignY = "bottom") { if (!ENABLE_HELP_CONCLUSION) return; if (text === undefined || text === null) text = "" if (typeof text == "string") text = text.slice(0, 200); // if (typeof text == "number") text = String(text); if (typeof text == "number") text = String(text); text = text.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/`/g, '`').replace(//g, ">").replace(/\n/gm, "
") let id = Math.random().toString(36).substring(2); let maey = alignY == "bottom" ? 0 : elegeta(".wcspu3top").map(e => e.getBoundingClientRect().bottom).reduce((a, b) => Math.max(a, b), 0) + 2; if (i > 0) $(`.pu3line${i}s`).remove() var ele = $(`${ text }`).appendTo('body'); let ey = ele[0]?.getBoundingClientRect()?.height if (ele[0].getBoundingClientRect().bottom >= (window.innerHeight)) { elegeta('.wcspu3top').forEach(e => { e.style.top = parseFloat(e?.style?.top) - (ey) - 2 + "px" }) } if (typeof text == "string") { maey += (text.match(/
/gmi) || []).length || 0; } //console.log((text.match(/
/gmi) || [] ).length) } setTimeout(() => { eleget0('//span[@id="wcspu3' + id + '"]')?.remove(); }, timer); } var maet; function popup2(text, i = 0, style = "", position = "bottom") { if (!ENABLE_HELP_CONCLUSION) return; text = String(text).replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/`/g, '`').replace(//g, ">").replace(/\n/gm, "
") var mae = eleget0('//span[@id="yhmbox"]'); if (maet && mae) { mae.remove(); clearTimeout(maet); } let bgcol = (pref("translucent") != "on") ? "#6080ff" : "#909090"; var ele = $(`${text}`).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 prefl(name, store = undefined, logLen = 50) { // prefl(name,data,len)で書き込み(数値でも文字列でも配列でもオブジェクトでも可)・"name+Log"にlen個の履歴保存、prefl(name)で読み出し if (store === undefined) { // 読み出し return pref(name); } else { // 書き込み、削除 if (store) { var a = pref(name + "Log") || []; a.unshift(store); a = [...new Set(a)]; pref(name + "Log", a.slice(0, logLen)); } return pref(name, store); } } 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") if (debug) 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 proInput(prom, defaultval, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) { let r = window.prompt(prom, defaultval) if (r === null) return null return Math.min(Math.max( Number(r.replace(/[A-Za-z0-9.]/g, function(s) { return String.fromCharCode(s.charCodeAt(0) - 65248); }).replace(/[^-^0-9^\.]/g, "")), min), max); } function notifyMe(body, title = "", clickfunc = null) { if (!("Notification" in window)) return; else if (Notification.permission == "granted") { var notify = new Notification(title, { body: body }); if (clickfunc) { notify.onclick = clickfunc } } 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) { $(`${title}`).appendTo(document.body).click(function() { func(); if (/removeWhenClicked/.test(command)) { $(this).remove(); } }); } // eleはスクロール画面内に入ってる? function isinscreen(ele, evencorner = 0, borderHeight = 0) { if (!ele) return; var eler = ele.getBoundingClientRect(); if (evencorner) return (eler.top > 0 - eler.height - borderHeight && eler.left > 0 && eler.left < document.documentElement.clientWidth && eler.top < Math.min(window.innerHeight, document.documentElement.clientHeight) + borderHeight); else return (eler.top > 0 - 0 && eler.left > 0 && eler.left + eler.width < document.documentElement.clientWidth && eler.top + eler.height < Math.min(window.innerHeight, document.documentElement.clientHeight) + 0); } function autoPagerized(callback) { callback(document.body) document.body.addEventListener('AutoPagerize_DOMNodeInserted', function(evt) { callback(evt.target); }, false); document.body.addEventListener('2chanReloaded', function() { setTimeout(() => { callback() }, 555) }, false); } function searchWithHistory(id, sitename, url, orSeparator = "|") { var selection = null; let prev = pref(id + " : searchWithHistory") let query = prompt(`${sitename}で全体検索します\n|でOR\n\n履歴(${id}):\n${ (pref(id + " : searchWithHistoryLog") || []).slice(0, 50).join("\n") }\n\n` + url.replace(/\*\*\*/, "${キーワード}") + '\n\n', selection || (prev ? prev + "|" : "")); if (query) { query = Array.from(new Set(query.replace(/\|/g, "|").replace(/|+/gmi, "|").split("|"))).join("|").replace(/^[|\|]+|[|\|]+$/gmi, "").trim() // 重複自動削除 if (!selection) prefl(id + " : searchWithHistory", query.replace(/\|/g, "|")); window.open(`${url.replace(/\*\*\*/,encodeURI(query.replace(/|/g,orSeparator)))}`); } return false; } function sec2hms(s) { return new Date(s * 1000).toISOString().substr(11, 8).replace(/^00\:0|^00\:/, ""); } function hms2sec(s) { return ((s.match0(/^(\d+):\d+:\d+$/) || 0) * 60 * 60) + ((s.match0(/^\d+:(\d+):\d+$/) || 0) * 60) + ((s.match0(/^(\d+):\d+$/) || 0) * 60) + ((s.match0(/^\d+:\d+:(\d+)$/) || 0) * 1) + ((s.match0(/^\d+:(\d+)$/) || 0) * 1); } function chapterMemo(requireUrlRE, videoTitleXP, newUrl, copy = 0) { if (!location.href.match0(requireUrlRE)) return var videoEle = eleget0('//video'); if (!videoEle) { return; } else { var currentTime = sec2hms(Math.floor(videoEle.currentTime)); } var videoTitleEle = eleget0(videoTitleXP); if (!videoTitleEle) return; var videoTitle = videoTitleEle.textContent; var curMemos = pref(SITE.id + ' : SearchMyMemo') || []; var chaMemos = curMemos.filter(e => (e.t == videoTitle && e.c == COLORVIDEOTIME)).sort((a, b) => hms2sec(a.m.match0(/^([\d:]+)\s/)) > hms2sec(b.m.match0(/^([\d:]+)\s/)) ? 1 : -1); var chaMemoTU = ""; chaMemos.forEach(c => { chaMemoTU += `${videoTitle} ${c.m}\n${newUrl.replace(/\*\*time\*\*/,hms2sec(c.m.match0(/^([\d:]+)\s/)))}\n` }) if (!copy) { var word = window.getSelection().toString().trim() || (prompt(`『${videoTitle}』\n${currentTime=="0:00"?"に付ける":"の "+currentTime+" に付けるチャプター"}メモを入力してください\n${chaMemoTU?"\n\n列挙(Shift+Uでコピー):\n"+chaMemoTU:""}\n`) || "").trim(); if (!word) return; storeMemo(videoTitle, (currentTime != "0:00" ? currentTime + " " : "") + word.trim(), currentTime == "0:00" ? COLOR1 : COLORVIDEOTIME) } else { GM.setClipboard(chaMemoTU) popup2(chaMemoTU, -1, "", "top") //var newstr = (pref(SITE.id + ' : SearchMyMemo') || []).filter(e => (e.c === COLORVIDEOTIME)); //prompt(`チャプターメモから再生するURLの列挙をコピーしました\n\n入力フォームよりチャプターメモのエクスポートとマージが行えます\nコピーしてテキストファイル等に保存すればエクスポートとなり、他環境からエクスポートしたものを入力すればマージになります\n変更せずにEnterかEscを押せば何もしません\n\n${JSON.stringify(newstr)}`, JSON.stringify(newstr)) } } // intervalが1以上かつ設定値がdefValueと違っていればintervalミリ秒事に再処理、そうでなければ割り込みはせず、初回の実行もしない function setSlider(placeEle, min = 0, max = 100, defValue = 0, title = "", key = "SliderValue", onchangecallback, interval = 0, addProperty = "") { // interval:1なら一回だけcallback実行、2~ならそのms間隔で定期実行 if (placeEle && !eleget0(`//input[@id="setSlider${key}"]`)) { let val = pref(key) || defValue; placeEle.insertAdjacentHTML("afterend", ``) let adjustFunc = function(key, interval = 0, defValue = 0, onchange = 0) { //popup2(`${interval} ${onchange}`) let sliderEle = eleget0(`#setSlider${key}`) let sliderEleNum = Number(sliderEle.value) onchangecallback(sliderEleNum) if (onchange) pref(key, sliderEleNum) if (interval && sliderEleNum != defValue) setTimeout(() => { adjustFunc(key, interval, defValue) }, interval) } let sliderEle = eleget0(`#setSlider${key}`) if (sliderEle) { sliderEle.addEventListener('input', () => adjustFunc(key, interval, defValue, 1)); if (Number(sliderEle.value) != defValue) adjustFunc(key, interval, defValue) } if (interval == 1) adjustFunc(key, 0, defValue) } } function domsort(container, doms, func, prepend = 0) { // prepend:1ならcontainerの最初に付ける、0なら最後に付ける doms.map(function(v) { return { dom: v, value: func(v) } }).sort(function(a, b) { return (typeof Number(a.value) && Number(b.value) ? (b.value - a.value) : (a.value < b.value ? 1 : -1)) }).forEach(function(v) { prepend ? container.prepend(v.dom) : container.appendChild(v.dom); }); } function ct(callback, name = "test", time = 1) { console.time(name); for (let i = time; i--;) { callback() } console.timeEnd(name) } // 速度測定 function lh(re) { let tmp = location.href.match(re); if (!tmp) { return null } else if (tmp.length > 1) { return tmp[1] } else return tmp[0] } // gフラグ不可 })();