// ==UserScript==
// @name ヤフオクで非表示とメモ
// @description q:非表示 w:アンドゥ b:NGワード Shift+Q:NG編集 12:メモを追加 34:自由メモ Shift+!:メモを編集 Shift+":自動メモのみ全削除 .:上限価格 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 *://*.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/web/waitfree_sale_list/*
// @match *://www.mangaz.com/*
// @match *://www.sukima.me/*
// @match *://*.userbenchmark.com/*
// @match *://www.hellowork.mhlw.go.jp/kensaku/*
// @match *://kakaku.com/*
// @match *://www.mercari.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 *://*.2chan.net/*
// @match *://kuzure.but.jp/*
// @match *://twitter.com/*
// @match *://www.nicovideo.me/*
// @match *://www.nicochart.jp/*
// @match *://pubmed.ncbi.nlm.nih.gov/?term=*
// @match *://pubmed.ncbi.nlm.nih.gov/?linkname=*
// @match *://pubmed.ncbi.nlm.nih.gov/*
// @match *://a-timesale.com/*
// @match *://rrws.info/*
// @match *://commons.nicovideo.jp/*
// @match *://scholar.google.tld/*
// @match *://hibiki-radio.jp/*
// @match *://www.onsen.ag/
// @match *://www.freem.ne.jp/*
// @match *://shopping.yahoo.co.jp/search*
// @match *://the360.life/*
// @match *://omocoro.jp/*
// @match *://minsoku.net/*
// @match https://refind2ch.org/search*
// @version 0.5.25
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_deleteValue
// @grant GM_addStyle
// @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 ENABLE_AUTOMEMO = 7; // 0:自動メモを無効 1でオン 2~7:大きくするほど一時的に表示が崩れる代わりに確実
const ENABLE_EXCEPT_YAJ = 1; // 1:ヤフオク以外でも有効 0:ヤフオクでのみ動作
const ENABLE_HELP = 1; // 1:操作ガイドを表示 0:無効
const WCA_HIDE_SOME_SITES = 0; // (Web漫画アンテナで)1:使いにくい又は遅いサイト(マンガPark、コミックファイア、コミックヴァルキリー、まんがライフSTORIA´、がうがうモンスター、Z、スポバトマンガ研究所、WEBコミックガンマ、COMICリュウ、新都社、COMIC FUZ、COMICフルール)の項目を隠す 0:無効
const REPLACE_LINK_IN_YOUTUBE = 1; // 1:YouTubeで投稿者のチャンネルのホームタブへのリンクをチャンネルの動画タブへのリンクに置き換える
const ENABLE_MEASURE_TIME_SPENT = 0; // 1で速度測定して表示 sw("項目")
const debug = 0; //Math.random() > 0.9; // 1~2だとデバッグモード dc(text)
const debug2 = 0; //Math.random() > 0.9; // 1だとデバッグモード 非対応ページでその旨表示など
var swb;
sw("reset") // = new Date();
const SITES_TO_BE_HIDDEN_XP = '//div[@class="entry-site"]/a[text()="マンガPark" or text()="コミックファイア" or text()="コミックヴァルキリー" or text()="まんがライフSTORIA´" or text()="COMICメテオ" or text()="がうがうモンスター" or text()="Z" or text()="スポバトマンガ研究所" or text()="WEBコミックガンマ" or text()="COMICリュウ" or text()="新都社" or text()="COMIC FUZ" or text()="COMICフルール"]/../..';
//const SITES_TO_BE_HIDDEN_XP = '//div[@class="entry-site"]/a[not(text()="マンガPark" or text()="コミックファイア" or text()="コミックヴァルキリー" or text()="まんがライフSTORIA´" or text()="COMICメテオ" or text()="がうがうモンスター" or text()="Z" or text()="スポバトマンガ研究所" or text()="WEBコミックガンマ" or text()="COMICリュウ" or text()="新都社" or text()="COMIC FUZ" or text()="COMICフルール")]/../..'; // 逆にこれらのサイトだけ表示する
if (window != parent) return;
const COLOR1 = "#6080ff",
COLOR2 = "#c03020",
COLOR3 = "#808080",
COLORCPUSCORE = "#a08000",
KEYHIDE = "q",
KEYUNDO = "w",
KEYBW = "b",
KEYEDIT = "Shift+Q",
// KEYEDIT2 = "Shift+B",
KEYMAXP = ".",
KEYMEMO1 = "1",
KEYMEMO2 = "2",
KEYMEMO1S = "3",
KEYMEMO2S = "4",
KEYTOGGLEtranslucent = "t",
KEYRESETMEMO = "Shift+!",
KEYRESETMEMOAUTO = "Shift+\"";
// 上が優先
const SITEINFO = [{
id: 'REFIND2CH',
urlRE: 'https://refind2ch.org/search',
listTitleXP: '//p[@class="list-group-item-heading thread_title h5"]|.//p[@class="list-group-item-heading h5 thread_title"]',
listTitleSearchXP: '//p[@class="list-group-item-heading thread_title h5"][+++]/../..|.//p[@class="list-group-item-heading h5 thread_title"][+++]/../..',
listTitleMemoSearchXP: '//p[@class="list-group-item-heading thread_title h5"][+++]|.//p[@class="list-group-item-heading h5 thread_title"][+++]',
listGen: 4,
observe: 500,
}, {
id: 'KAKAKUBB',
urlRE: '//kakaku.com/bb/',
listTitleXP: '//a[@class="planName"]',
listTitleSearchXP: '//a[@class="planName"][+++]/../../../../..',
listTitleMemoSearchXP: '//a[@class="planName"][+++]',
listGen: 3,
}, {
id: 'MINSOKU',
urlRE: '//minsoku.net/',
listTitleXP: '//div/div[@class="text-bold mt-xxs"]/a|.//div/div[@class="mt-10 text-bold"]/a|.//div[@class="mt-10 mb--xxxs text-bold"]/a',
listTitleSearchXP: '//div/div[@class="text-bold mt-xxs"]/a[+++]/../../..|.//div/div[@class="mt-10 text-bold"]/a[+++]/../../..|.//div[@class="mt-10 mb--xxxs text-bold"]/a[+++]/../../..',
listTitleMemoSearchXP: '//div/div[@class="text-bold mt-xxs"]/a[+++]|.//div/div[@class="mt-10 text-bold"]/a[+++]|.//div[@class="mt-10 mb--xxxs text-bold"]/a[+++]',
listGen: 4,
}, {
id: 'OMOCORO',
urlRE: '//omocoro.jp/',
listTitleXP: '//div[@class="details"]/div[@class="title"]/a',
listTitleSearchXP: '//div[@class="details"]/div[@class="title"]/a[+++]/../../..',
listTitleMemoSearchXP: '//div[@class="details"]/div[@class="title"]/a[+++]',
listGen: 4,
}, {
id: 'THE360LIFE',
urlRE: '//the360.life/',
listTitleXP: '//a/div/div[contains(@class,"s-ls2_title")]/pre',
listTitleSearchXP: '//a/div/div[contains(@class,"s-ls2_title")]/pre[+++]/../../../..',
listTitleMemoSearchXP: '//a/div/div[contains(@class,"s-ls2_title")]/pre[+++]|//div[@class="art-dtl-txt"]/h1[@class="art-dtl-txt1"][+++]',
listGen: 5,
detailURLRE: /\/\/the360\.life\/U1301/,
detailTitleXP: '//div[@class="art-dtl-txt"]/h1[@class="art-dtl-txt1"]',
detailTitleSearchXP: '//div[@class="art-dtl-txt"]/h1[@class="art-dtl-txt1"][+++]/../../..',
redoWhenReturned: 1,
observe: 1000,
}, {
id: 'SHOPPING_YAHOO',
urlRE: '//shopping.yahoo.co.jp/search',
listTitleXP: '//div[2]/p/a[@target="_blank" and @data-rapid_p="1"]/span',
listTitleSearchXP: '//div[2]/p/a[@target="_blank" and @data-rapid_p="1"]/span[+++]/../../../../..',
listTitleMemoSearchXP: '//li[@class="LoopList__item"]/div/div[2]/p/a[@target="_blank" and @data-rapid_p="1"]/span[+++]',
listGen: 6,
func: () => { // 商品名を省略しなくする
elegeta('//div[2]/p/a[@target="_blank" and @data-rapid_p="1"]/span/..').forEach(e => {
e.style.display = "block";
e.style.maxHeight = "none";
});
},
observe: 1000,
}, {
id: 'FREEM',
urlRE: '//www.freem.ne.jp/',
listTitleXP: '//a/h3[@class="pc"]',
listTitleSearchXP: '//ul[contains(@class,"game-list game-list-wrap row")]/li/a/h3[@class="pc"][+++]/../..',
listTitleMemoSearchXP: '//ul[contains(@class,"game-list game-list-wrap row")]/li/a/h3[@class="pc"][+++]',
listGen: 3,
}, {
id: 'ONSEN',
urlRE: '//www.onsen.ag/',
listTitleXP: '//h4[@class="title"]',
listTitleSearchXP: '//h4[@class="title"][+++]/../..',
listTitleMemoSearchXP: '//h4[@class="title"][+++]',
listGen: 4,
observe: 500,
}, {
id: 'HIBIKI',
urlRE: '//hibiki-radio.jp',
listTitleXP: '//div[@class="title program-title-animate ng-binding"]',
listTitleSearchXP: '//div[@class="title program-title-animate ng-binding"][+++]/../../..',
listTitleMemoSearchXP: '//div[@class="title program-title-animate ng-binding"][+++]',
listGen: 3,
observe: 500,
}, {
id: 'GOOGLE_SCHOLAR',
urlRE: '//scholar\.google\..*/',
listTitleXP: '//h3[@class="gs_rt"]/a',
listTitleSearchXP: '//h3[@class="gs_rt"]/a[++url++]/../../..',
listTitleMemoSearchXP: '//h3[@class="gs_rt"]/a[++url++]',
listGen: 3,
useURL: 1,
disableKeyB: 1,
}, {
id: 'NICODOUGA',
urlRE: '//commons.nicovideo.jp/',
listTitleXP: '//a[@class="title_link"]',
listTitleSearchXP: '//a[@class="title_link"][+++]/..',
listTitleMemoSearchXP: '//a[@class="title_link"][+++]', // ちゃんと動かない
listGen: 2,
observe: 500,
}, {
id: 'RRWS',
urlRE: '//rrws.info/',
listTitleXP: '//h2[@class="entry-card-title card-title e-card-title"]',
listTitleSearchXP: '//h2[@class="entry-card-title card-title e-card-title"][***]/../../..',
listTitleMemoSearchXP: '//h2[@class="entry-card-title card-title e-card-title"][***]|//h1[@class="entry-title"][***]',
listGen: 3,
detailURLRE: /rrws.info\/archives\//,
detailTitleXP: '//h1[@class="entry-title"]',
detailTitleSearchXP: '//h1[@class="entry-title"][***]/../..',
trim: 1,
}, {
id: 'A-TIMESALE',
urlRE: '//a-timesale.com/',
listTitleXP: '//a[@class="item-text-link"]',
listTitleSearchXP: '//a[@class="item-text-link"][**title**]/../..',
listTitleMemoSearchXP: '//a[@class="item-text-link"][**title**]',
listGen: 2,
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: 'FUTABA',
urlRE: '//.*?.2chan.net/|//kuzure.but.jp/',
listTitleXP: '//td/span[@class="cno"]',
listTitleSearchXP: '//td/span[@class="cno"][+++]/../../../..',
listTitleMemoSearchXP: '//td/span[@class="cno"][+++]',
listGen: 4,
}, {
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,
}, {
id: 'YOUTUBE',
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\?/,
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"]',
listTitleSearchXP: '//div/ytd-rich-grid-renderer[@class="style-scope ytd-two-column-search-results-renderer" and @style="--ytd-rich-grid-items-per-row:4; --ytd-rich-grid-posts-per-row:4; --ytd-rich-grid-movies-per-row:8;"]/div[last()]/ytd-rich-item-renderer/div[@id="content"]/ytd-rich-grid-media[@class="style-scope ytd-rich-item-renderer" and @lockup=""]/div[1]/div/div[1]/div[@class="byline style-scope ytd-rich-grid-media"]/ytd-video-meta-block/div[1]/div[@id="byline-container"]/ytd-channel-name[@id="channel-name" and @class="style-scope ytd-video-meta-block"]/div[@id="container"]/div/yt-formatted-string[@class="style-scope ytd-channel-name complex-string"]/a[+++]/../../../../../../../../../../../../../..|.//ytd-channel-name[@id="channel-name" and @class="long-byline style-scope ytd-video-renderer"]/div/div[@id="text-container" and @class="style-scope ytd-channel-name"]/yt-formatted-string[@id="text" and @class="style-scope ytd-channel-name"]/a[@class="yt-simple-endpoint style-scope yt-formatted-string"][+++]/../../../../../../..|.//div[@id="primary"]/ytd-rich-grid-renderer[@class="style-scope ytd-two-column-search-results-renderer" and @style="--ytd-rich-grid-items-per-row:4; --ytd-rich-grid-posts-per-row:4; --ytd-rich-grid-movies-per-row:8;"]/div[@id="contents"]/ytd-rich-item-renderer/div[@class="style-scope ytd-rich-item-renderer"]/ytd-rich-grid-media[@class="style-scope ytd-rich-item-renderer"]/div/div/div[@id="meta"]/h3/a/yt-formatted-string[@class="style-scope ytd-rich-grid-media"][+++]/../../../../../../../..|.//ytd-app/div[@id="content"]/ytd-page-manager[@id="page-manager"]/ytd-search[@class="style-scope ytd-page-manager" and @role="main"]/div[1]/ytd-two-column-search-results-renderer[@prominent-thumb-style="DEFAULT"]/div/ytd-section-list-renderer/div[2]/ytd-item-section-renderer[@class="style-scope ytd-section-list-renderer" and @use-height-hack=""]/div[3]/ytd-video-renderer[@prominent-thumb-style="DEFAULT" and @use-prominent-thumbs=""]/div[@id="dismissable"]/div/div/div[@id="title-wrapper" and @class="style-scope ytd-video-renderer"]/h3/a[@id="video-title"]/yt-formatted-string[@class="style-scope ytd-video-renderer"][+++]/../../../../../../..|//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"][+++]/following::a|.//div[@class="style-scope ytd-grid-video-renderer"]/h3/a[@id="video-title" and @class="yt-simple-endpoint style-scope ytd-grid-video-renderer"][+++]/../../../../..|.//ytd-rich-grid-renderer[@class="style-scope ytd-two-column-browse-results-renderer"]/div[6]/ytd-rich-item-renderer[@class="style-scope ytd-rich-grid-renderer"]/div/ytd-rich-grid-media[@class="style-scope ytd-rich-item-renderer"]/div[@id="dismissable" and @class="style-scope ytd-rich-grid-media"]/div[@id="details" and @class="style-scope ytd-rich-grid-media"]/div[@id="meta" and @class="style-scope ytd-rich-grid-media"]/h3[@class="style-scope ytd-rich-grid-media"]/a[@class="yt-simple-endpoint style-scope ytd-rich-grid-media"]/yt-formatted-string[+++]/../../../../../../../..|.//ytd-video-meta-block[@rich-meta=""]/div[@id="metadata"]/div[@id="byline-container" and @class="style-scope ytd-video-meta-block"]/ytd-channel-name[@class="style-scope ytd-video-meta-block"]/div[@id="container" and @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" and @ellipsis-truncate="" and @has-link-only_=""]/a[@class="yt-simple-endpoint style-scope yt-formatted-string" and @spellcheck="false"][+++]/../../../../../../../../../../../../../..|.//div[2]/div/div[@class="style-scope ytd-playlist-video-renderer"]/h3[@class="style-scope ytd-playlist-video-renderer"]/a[**title**]/../../../../..', // 新旧UI、縦1列・縦横をrow:で判定 contains排除
listTitleMemoSearchXP: '//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"][+++]',
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="dismissable" 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"]',
// redoWhenReturned: 1,
listGen: 7,
observe: 500,
observeId: "dismissable",
disableKeyB: 1,
func: function(node) {
if (REPLACE_LINK_IN_YOUTUBE) {
for (let e of elegeta('//ytd-video-meta-block[@rich-meta=""]/div[@id="metadata" and @class="style-scope ytd-video-meta-block"]/div[@class="style-scope ytd-video-meta-block"]/ytd-channel-name[@id="channel-name" and @class="style-scope ytd-video-meta-block"]/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 complex-string"]/a|.//yt-formatted-string[@id="text" and @class="style-scope ytd-channel-name" and @has-link-only_=""]/a[@class="yt-simple-endpoint style-scope yt-formatted-string" and @spellcheck="false"]|//ytd-channel-name[@wrap-text=""]/div/div[@id="text-container" and @class="style-scope ytd-channel-name"]/yt-formatted-string/a[@class="yt-simple-endpoint style-scope yt-formatted-string"]', node)) {
if (e.href.match(/\/channel\/[^\/]+$|\/user\/[^\/]+$/)) e.href = e.href + "/videos";
}
}
},
// helpOnDNI:1,
/* func: () => {
// URL変更して視聴画面に移ったらショートカットキーを削除(不完全)
var observeUrlHasChangedhref = location.href;
var observeUrlHasChanged = new MutationObserver(mutations => {
if (observeUrlHasChangedhref != location.href) {
var observeUrlHasChangedhref = location.href;
if (keyListen && location.href.match(/watch/)) document.removeEventListener("keydown", keyListen);
}
});
observeUrlHasChanged.observe(document, { childList: true, subtree: true });
},
*/
redoWhenReturned: 1,
}, {
/* id: 'YOUTUBE',
urlRE: '//www.youtube.com/results',
listTitleXP: '//a/yt-formatted-string[@class="style-scope ytd-video-renderer"]/..',
listTitleSearchXP: '//a/yt-formatted-string[@class="style-scope ytd-video-renderer"][+++]/../../../../../../..|//div[@id="text-container" and @class="style-scope ytd-channel-name"]/yt-formatted-string[@has-link-only_=""]/a[@class="yt-simple-endpoint style-scope yt-formatted-string" and @spellcheck="false"][+++]/../../../../../../..',
listTitleMemoSearchXP: '//a/yt-formatted-string[@class="style-scope ytd-video-renderer"][+++]',
listTitleXP2: '//div[@id="text-container" and @class="style-scope ytd-channel-name"]/yt-formatted-string[@has-link-only_=""]/a[@class="yt-simple-endpoint style-scope yt-formatted-string" and @spellcheck="false"]',
listGen: 7,
observe: 500,
observeId: "dismissable",
disableKeyB: 1,
// helpOnDNI:1,
func: () => {
// URL変更して視聴画面に移ったらショートカットキーを削除(不完全)
var observeUrlHasChangedhref = location.href;
var observeUrlHasChanged = new MutationObserver(mutations => {
if (observeUrlHasChangedhref != location.href) {
var observeUrlHasChangedhref = location.href;
if (keyListen && location.href.match(/watch/)) document.removeEventListener("keydown", keyListen);
}
});
observeUrlHasChanged.observe(document, { childList: true, subtree: true });
},
redoWhenReturned: 1,
}, {
id: 'YOUTUBE',
urlRE: '//www.youtube.com/channel/|//www.youtube.com/playlist|//www.youtube.com/c/|//www.youtube.com/user/',
listTitleXP: '//a[@id="video-title"]|.//h3/span[@id="video-title"]',
listTitleXP2: '//div/ytd-channel-name[@class="style-scope ytd-c4-tabbed-header-renderer"]/div[@id="container"]/div/yt-formatted-string[@class="style-scope ytd-channel-name"]',
listTitleSearchXP: '//a[@id="video-title"][+++]/../../../../..|.//h3/span[@id="video-title" and ***]/../../../../..',
listTitleMemoSearchXP: '//a[@id="video-title"][+++]|.//h3/span[@id="video-title"][***]',
listGen: 5,
observe: 500,
observeId: "dismissable",
disableKeyB: 1,
func: () => {
var observeUrlHasChangedhref = location.href;
var observeUrlHasChanged = new MutationObserver(mutations => {
if (observeUrlHasChangedhref != location.href) {
var observeUrlHasChangedhref = location.href;
if (keyListen && location.href.match(/watch/)) document.removeEventListener("keydown", keyListen);
}
});
observeUrlHasChanged.observe(document, { childList: true, subtree: true });
} // URL変更して視聴画面に移ったらショートカットキーを削除(不完全)
}, {
*/
id: 'IHERB',
urlRE: '//.*.iherb.com/',
listTitleXP: '//div[@class="absolute-link-wrapper"]/a',
listTitleSearchXP: '//div[@class="absolute-link-wrapper"]/a[**title**]/../../..',
listTitleMemoSearchXP: '//div[@class="absolute-link-wrapper"]/a[**title**]|.//section[3]/div/h1[@id="name" and +++]',
listGen: 3,
detailURLRE: /iherb.com\/pr\//,
detailTitleXP: '//section[3]/div/h1[@id="name"]',
detailTitleSearchXP: '//section[3]/div/h1[@id="name" and +++]/../../../../..',
func: () => { { GM_addStyle('.product-column .product { height: auto; min-height:395px; }'); } }, // 商品ブロックの縦幅固定をやめる
}, {
id: 'YODOBASHI',
urlRE: '//www.yodobashi.com/',
listTitleXP: '//div[@class="pName fs14"]/p[2]|.//div[@class="product js_productName"]',
listTitleSearchXP: '//div[@class="pName fs14"]/p[2][+++]/../../..|.//div[@class="product js_productName" and +++]/../../..|.//div[@class="product js_productName" and +++]/../../../../..',
listTitleMemoSearchXP: '//div[@class="pName fs14"]/p[2][+++]|.//div[3]/h1[@id="products_maintitle"]/span[1][+++]|.//div[@class="product js_productName" and +++]|.//div[@class="product js_productName"][+++]',
listGen: 4,
listHelpXP: '//div[@class="pName fs14"]/p[2]/../../..',
detailURLRE: /\/www.yodobashi.com\/product\//,
detailTitleXP: '//div[3]/h1[@id="products_maintitle"]/span[1]',
detailTitleSearchXP: '//div[3]/h1[@id="products_maintitle"]/span[1][+++]/../../../../..',
hideListEvenDetail: 1,
observe: 500,
}, {
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',
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: 'MERCARI',
urlRE: '//www.mercari.com/',
listTitleXP: '//div[@class="items-box-body"]/h3[@class="items-box-name font-2"]',
listTitleSearchXP: '//div[@class="items-box-body"]/h3[@class="items-box-name font-2" and +++]/../../..',
listTitleMemoSearchXP: '//div[@class="items-box-body"]/h3[@class="items-box-name font-2" and +++]|//div[@class="default-container "]/section/h1[@class="item-name" and +++]',
listGen: 4,
observe: 1000,
detailURLRE: /\/\/www.mercari.com\/jp\/items\//,
detailTitleXP: '//div[@class="default-container "]/section/h1[@class="item-name"]',
detailTitleSearchXP: '//div[@class="default-container "]/section/h1[@class="item-name" and +++]/..',
automemoURLRE: "//www.mercari.com/jp/items/",
automemoSearchFunc: () => { return eletext('//p[@class="item-description-inner"]') + '\n'; },
automemoFunc: () => {
for (let am of CUSTOMAUTOMEMORE) { autoMemo(am); }
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);
},
},
{
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(/(.*)/); },
}, {
id: 'SUKIMA',
urlRE: '//www.sukima.me/',
/*listTitleXP: '//div[@class="row ma-0 flex-nowrap align-center"]/div[1]',
listTitleSearchXP: '//div[@class="row ma-0 flex-nowrap align-center"]/div[1][***]/../../../..',
listTitleMemoSearchXP: '//div[@class="row ma-0 flex-nowrap align-center"]/div[1][***]|.//div[@class="v-main__wrap"]/div/div/h1[***]',
listHelpXP: '//div[@class="row ma-0 flex-nowrap align-center"]/div[1]/../../../..',
*/
listTitleXP: '//div[@class="w-100 text-truncate text--secondary"]',
listTitleSearchXP: '//div[@class="w-100 text-truncate text--secondary"][***]/../../../..',
listTitleMemoSearchXP: '//div[@class="w-100 text-truncate text--secondary"][***]|.//div[@class="v-main__wrap"]/div/div/h1[***]',
listHelpXP: '//div[@class="w-100 text-truncate text--secondary"]/../../../..',
urlRE: '//www.sukima.me/(?!bv|login)',
titleProcessFunc: title => { return title.replace(/\n\s*?\n\s*?|(?分冊版)?.*|【期間限定 無料お試し版】.*|[0-90-9]*?巻.*/g, "").trim() },
listGen: 6,
observe: 1500,
detailURLRE: /\/book\/title\//,
detailTitleXP: '//div[@class="v-main__wrap"]/div/div/h1',
detailTitleSearchXP: '//div[@class="v-main__wrap"]/div/div/h1[***]/../..',
hideListEvenDetail: 1,
delay: 1600,
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");
} // ページタイトルの「[全話無料]」等の接頭辞を末尾に移動
},
{
id: 'MANGAZ',
urlRE: '//www.mangaz.com/',
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/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,
}, {
id: 'ALIEXPRESS',
urlRE: '//.*.aliexpress.com/af/|//.*.aliexpress.com/item/|//.*.aliexpress.com/wholesale',
listTitleXP: '//a[@class="item-title"]|.//a[@class="store-name"]',
listHelpXP: '//a[@class="item-title"]|.//a[@class="store-name"]',
listTitleSearchXP: '//a[@class="item-title" and ***]/../../../../..|.//a[@class="store-name" and +++]/../../../../..',
listTitleMemoSearchXP: '//a[@class="item-title" and ***]|.//h1[@class="product-title-text" and ***]|.//a[@class="store-name" and +++]/../..|.//div[@class="shop-name"]/a[+++]/..',
listGen: 6,
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[@class="item-title"]').forEach(e => { e.style.whiteSpace = ""; });
elegeta('//div[@class="item-title-wrap"]').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,
}, {
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: 'JMTY',
urlRE: '//jmty.jp/',
listTitleXP: '//div/h2[@class="p-item-title"]/a',
listTitleSearchXP: '//div/h2[@class="p-item-title"]/a[+++]/../../..',
listTitleMemoSearchXP: '//div/h2[@class="p-item-title"]/a[+++]',
listGen: 5,useURL:1,
*/
}, {
id: 'EBAY',
urlRE: 'ebay.com/',
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, // 並べ替え時に必要
}, {
id: '5CH',
urlRE: '.5ch.net/test/read.cgi/',
/*listTitleXP: '//span[@class="number"]', // 項目名はレス番号
listTitleSearchXP: '//span[@class="number" and +++]/../..|//span[@class="escaped"][***]/../..',
listTitleMemoSearchXP: '//span[@class="number" and +++]',
*/
/* listTitleXP: '//span[@class="date"]', // 項目名は書き込み日時
listTitleSearchXP: '//span[@class="date" and +++]/../..|//span[@class="escaped"][***]/../..',
listTitleMemoSearchXP: '//span[@class="date" and +++]',
listGen: 4,
*/
listTitleXP: '//div[@class="meta"]', // 項目名はレス番~IDまでの一連のdiv.meta
listTitleSearchXP: '//div[@class="meta"][**title**]/..|//span[@class="escaped"][***]/../..',
listTitleMemoSearchXP: '//div[@class="meta"][**title**]/span[@class="date"]',
listHelpXP: '//div/div[@class="post"]',
listGen: 6,
searchAllowLength: 1,
listTitleSearchFunc: (title) => { // レス中キーワードNG
let resHit = [];
if (typeof title === "string" && /\D/m.test(title)) { // textContentでサーチする
for (let res of elegeta('//div[@class="message"]')) { // レス本文
if (res.textContent.indexOf(title) !== -1) resHit.push(res.parentNode);
}
for (let res of elegeta('//span[@class="uid"]')) { // ID
if (res.textContent.indexOf(title) !== -1) resHit.push(res.parentNode.parentNode);
}
}
return resHit;
},
funcQ: function() {
setTimeout(() => {
$('div.post:hidden').next("br").css("display", "none");
$('div.post:visible').next("br:hidden").css("display", "block");
}, 200);
}, //余計な改行を詰める
funcB: () => SITE.funcQ(),
func: () => {
for (let e of elegeta('//div[@class="meta"]')) { // レスの特定のために1行目をまとめてtitle属性に埋める
let id = e.innerText.replace(/>>.*/g, "");
e.title = id;
};
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 + ' キー:
『' + selectedStr + '』
をNGワードに追加', 1);
}
}
});
},
hideSelectedWord: 1,
}, {
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,
listHelpXP: '//div[@class="VideoMediaObject-title"]/a/../../../..',
}, {
id: 'NICODOUGA',
urlRE: '//www.nicovideo.jp/search/|//www.nicovideo.jp/tag/',
listTitleXP: '//div/p[@class="itemTitle"]/a',
listTitleSearchXP: '//div/p[@class="itemTitle"]/a[**title**]/../../..',
listTitleMemoSearchXP: '//div/p[@class="itemTitle"]/a[**title**]',
listGen: 7,
// func: function(node) { for (let ele of elegeta('//div/p[@class="itemTitle"]/a', node)) ele.textContent = ele.title; }, // 長いタイトルが...で省略されているとヒットしないのでtitleプロパティから取り出す
// }, {
// id: 'NICODOUGA', // URLをキーにする
// urlRE: '//www.nicovideo.jp/user/.*/video',
// listTitleXP: '//a[@class="VideoMediaObject-linkArea"]',
// listTitleSearchXP: '//a[@class="VideoMediaObject-linkArea"][++url++]/..',
// listTitleMemoSearchXP: '//a[@class="VideoMediaObject-linkArea"][++url++]/div[2]/span',
// listGen: 6,
// useURL: 1,
// observe: 500,
// //func: function(node) { for (let ele of elegeta('//div/p[@class="itemTitle"]/a', node)) ele.textContent = ele.title; }, // 長いタイトルが...で省略されているとヒットしないのでtitleプロパティから取り出す
}, {
id: 'NICODOUGA', // タイトルをキーにする
urlRE: '//www.nicovideo.jp/user/.*/video',
listTitleXP: '//div[@class="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: '//span[@class="VideoMediaObject-bodyTitle"]',
listTitleSearchXP: '//span[@class="VideoMediaObject-bodyTitle"][+++]/../../../..',
listTitleMemoSearchXP: '//span[@class="VideoMediaObject-bodyTitle"][+++]',
listGen: 4,
observe: 500,
listTitleXPIgnoreNotExist: 1,
// reloadWhenUrlHasChanged:1,
}, {
id: 'NICODOUGA',
urlRE: '//www.nicovideo.jp/my/mylist|www.nicovideo.jp/my/watchlater',
listTitleXP: '//span[@class="VideoMediaObject-bodyTitle"]',
listTitleSearchXP: '//span[@class="VideoMediaObject-bodyTitle"][+++]/../../../../..',
listTitleMemoSearchXP: '//span[@class="VideoMediaObject-bodyTitle"][+++]',
listGen: 5,
listTitleXPIgnoreNotExist: 1,
// reloadWhenUrlHasChanged:1,
}, {
id: 'RTINGS',
urlRE: 'www.rtings.com/.*?/tools/table|//www.rtings.com/.*?/reviews/',
listTitleXP: '//a[@class="table_cell_product-link"]/span',
listTitleSearchXP: '//a[@class="table_cell_product-link"]/span[***]/../../../..|//div[@class="product_page-banner-header"]/div[@class="product_page-title"]/h1/span[***]/../..',
listTitleMemoSearchXP: '//a[@class="table_cell_product-link"]/span[***]/..|//div[@class="product_page-title"]/h1/span[***]',
listGen: 3,
listTitleXPIgnoreNotExist: 1,
delay: 3000,
observe: 1000,
detailURLRE: /\/\/www.rtings.com\/.*?\/reviews\//,
detailTitleXP: '//div[@class="product_page-title"]/h1/span[1]',
detailTitleSearchXP: '//div[@class="product_page-title"]/h1/span[1 and ***]/../../../../..',
}, {
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/free/|//ebookjapan.yahoo.co.jp/ranking/details/free/',
listTitleXP: '//p[@class="book-item__title"]',
listTitleSearchXP: '//p[@class="book-item__title" and ***]/../../../..',
listTitleMemoSearchXP: '//p[@class="book-item__title" and ***]',
listGen: 3,
titleProcessFunc: (title) => { return title.replace(/\s[0-90-9]+巻?$/gmi, "").replace(/[(\(][0-90-9]+巻?[)\)]$/gmi, "").replace(/【期間限定.*?】|【フルカラー】/g, "").replace(/\s\d+冊/gmi, "").trim() },
observe: 1000,
redoWhenReturned: 1,
}, {
id: 'TAMESHIYOMI',
urlRE: 'booklive.jp/index/no-charge',
listTitleXP: '//div[@class="title"]/a',
listTitleSearchXP: '//div[@class="title"]/a[***]/../..',
listTitleMemoSearchXP: '//div[@class="title"]/a[***]',
listGen: 4,
titleProcessFunc: (title) => { return title.replace(/\s[0-90-9]+巻?$/gmi, "").replace(/[(\(][0-90-9]+巻?[)\)]/gmi, "").replace(/【.*?】|(.*?)|分冊版|合冊版/g, "").trim() },
listTitleXPIgnoreNotExist: 1,
observe: 1000,
redoWhenReturned: 1,
}, {
id: 'WCA',
urlRE: 'webcomics\.jp',
listTitleXP: '//div[@class="entry-title"]/a[1]',
// listTitleXP2: '//div[@class="entry-site"]/a[1]',
//listTitleSearchXP: '//div[@class="entry-title"]/a[***]/../..|//div/div[@class="entry-site"]/a[+++]/../..', // 部分一致でヒット+漫画サイト名にもヒット(低速)
//listTitleSearchXP: '//div[@class="entry-title"]/a[***]/../..', // 部分一致でヒット+漫画サイト名にはヒットしない(中速)
//listTitleSearchXP: '//div[@class="entry-title"]/a[+++]/../..|//div/div[@class="entry-site"]/a[+++]/../..', // 完全一致のみヒット+漫画サイト名にもヒット(中高速)
listTitleSearchXP: '//div[@class="entry-title"]/a[+++]/../..', // 完全一致のキーワードのみヒット+漫画サイト名にはヒットしない(高速)
// listTitleSearchXP: '//div[@class="entry-title"]/a[+++]/../..|.//div[@class="entry-site"]/a[1][+++]/../..', // 完全一致のキーワードのみヒット+漫画サイト名にはヒットしない(高速)+xp2対応
listTitleMemoSearchXP: '//div[@class="entry-title"]/a[+++]',
listGen: 5,
listHelpJQS: 'div.entry',
helpInBlock: 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) }
},
autoTranslucentURLRE: /mylist|bookmark/,
}, {
id: 'YAJ2',
urlRE: '://auctions.yahoo.co.jp/search/|://page.auctions.yahoo.co.jp/jp/auction/|://auctions.yahoo.co.jp/category/list/',
// 1.出品物名と出品者名で別々にQ/1/2ができる代わりに当たり判定が狭い
// listTitleXP: '//a[@class="Product__titleLink"]|.//a[@class="Product__titleLink u-textBold"]|.//div[@class="a1wrp"]/h3/a|.//div/a[@class="Product__seller"]',
// listTitleMemoSearchXP: '//a[contains(@class,"Product__titleLink") and ***]|.//h1[@class="ProductTitle__text" and ***]/..|.//div[@class="a1wrp"]/h3/a[***]|.//div/a[@class="Product__seller" and +++]|//span[@class="Seller__name"]/a[+++]',
// listTitleSearchXP: '//a[contains(@class,"Product__titleLink") and ***]/../../../../..|.//div[@class="a1wrp"]/h3/a[***]/../../../..|.//div[@class="a1wrp"]/h3/a/em[***]/../../../..|.//div/a[@class="Product__seller" and +++]/../../../../..',
// listHelpXP: '//div[@class="Product__infoTable"]',
// 2.出品者名でQ/1/2ができない代わりに当たり判定が広い
listTitleXP: '//a[@class="Product__titleLink"]|.//a[@class="Product__titleLink u-textBold"]|.//div[@class="a1wrp"]/h3/a',
listTitleXP2: '//div[@class="Product__sellerArea"]/a|//span[@class="Seller__name"]/a[1]',
listTitleMemoSearchXP: '//a[contains(@class,"Product__titleLink") and ***]|.//h1[@class="ProductTitle__text" and ***]/..|.//div[@class="a1wrp"]/h3/a[***]',
listTitleSearchXP: '//a[contains(@class,"Product__titleLink") and ***]/../../../../..|.//div[@class="a1wrp"]/h3/a[***]/../../../..|.//div[@class="a1wrp"]/h3/a/em[***]/../../../..|.//div[@class="Product__sellerArea"]/a[+++]/../../../../..',
// listTitleSearchXP: '//a[contains(@class,"Product__titleLink") and ***]/../../../../..|.//div[@class="a1wrp"]/h3/a[***]/../../../..|.//div[@class="a1wrp"]/h3/a/em[***]/../../../..',
listHelpJQS: "li[class='Product']",
listGen: 4,
helpInBlock: 1,
wholeHelp: " " + KEYMAXP + ":価格上限",
detailURLRE: /:\/\/page.auctions.yahoo.co.jp\/jp\/auction\//,
detailTitleXP: '//h1[@class="ProductTitle__text"]',
detailTitleSearchXP: '//h1[@class="ProductTitle__text" and ***]/../../../..|//span[@class="Seller__name"]/a[+++]/../../../../../../../../../../..|.//span[@class="Seller__name"]/a[1][+++]',
// detailTitleSearchXP: '//h1[@class="ProductTitle__text" and ***]/../../../..|//span[@class="Seller__name"]/a[+++]/../../../../../../../../../../..',
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',
listGen: 4,
listHelpJQS: "div.a1,#list01 table tbody tr td",
listTitleSearchXP: '//div[@class="a1wrp"]/h3/a[***]/../../../..|.//div[@class="a1wrp"]/h3/a/em[***]/../../../../..',
listTitleMemoSearchXP: '//div[@class="a1wrp"]/h3/a[***]|.//div[@class="a1wrp"]/h3/a/em[***]/..',
redoWhenReturned: 1,
}, {
id: 'YAJ2',
urlRE: 'userbenchmark',
}, {
id: 'AMAZON',
urlRE: /www\.amazon\.co\.jp\/s\?k\=|www\.amazon\.co\.jp.*\/dp\/.*/,
listTitleXP: '//span[@class="a-size-base-plus a-color-base a-text-normal"]|//span[@id="productTitle"]',
listTitleSearchXP: '//span[@class="a-size-base-plus a-color-base a-text-normal" and ***]/../../../../../../../..|.//a[@class="a-link-normal"]/div[@data-rows="4" and ***]/../../..|.//img[@class="a-dynamic-image" and **alt**]/../../..|.//a[@class="a-link-normal"]/div[@data-rows="4"][***]',
listTitleMemoSearchXP: '//span[@class="a-size-base-plus a-color-base a-text-normal" and ***]/..|//span[@id="productTitle" and ***]/..|.//a[@class="a-link-normal"]/div[@data-rows="4"][***]',
listGen: 12,
listHelpXP: '//span[@class="a-size-base-plus a-color-base a-text-normal"]/../../../..|//span[@id="productTitle"]/../../../..',
trim: true,
observe: 200,
// listHelpJQS: 'div[data-asin]',
detailURLRE: /\/dp\/|\/product-reviews\//,
detailTitleXP: '//h1[@id="title"]/span[@id="productTitle"]',
detailTitleSearchXP: '//span[@id="productTitle" and ***]/../../../../../..|//h1/a[@class="a-link-normal" and ***]/../../../../../../../../../../../../..',
hideListEvenDetail: 1,
},
/* {
id: '', // GM_setValueで保存するグループ名 同じグループは設定が共通になる
urlRE: '', // 動作するサイトのURLの一部(正規表現)
necessaryToWork: /$^/, // これがあるとdocument.bodyにこれにmatchする文字列がなければ動作を停止する urlREだけでは非対応ページを絞り込めない時に使用
listTitleXP: '', // 項目一覧ページの項目名を特定できる要素のXPath title>text>altの順にあるものから利用される
listTitleXP2: '', // 項目一覧ページの項目名の第2候補を指すXPath これにホバーしていればQキーでこれのinnerTextでもNG登録できる
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を=で検索(要useURL)
listGen: 3, // Q12を押した場所の要素からいくつ上まで遡った要素までを当たり判定にするか 必要最小限にする
listHelpJQS: '', // 項目一覧ページで操作ガイドを表示する要素のJQueryセレクタ ↓でも良い 両方を省略するとlistTitleXPの2つ親の要素で代用 当たり判定とは関係ない
listHelpXP: '', // 項目一覧ページで操作ガイドを表示する要素のXpath ↑でも良い 両方を省略するとlistTitleXPの2つ親の要素で代用 当たり判定とは関係ない
helpInBlock: 0, // 1だと操作ガイドを要素のブロック内に表示する
detailURLRE: //, // URLにmatchする正規表現、matchすると個別詳細画面だと判断する
detailTitleXP: '', // 詳細画面で項目名を指すXPath
detailTitleSearchXP: '', // 詳細画面で非表示化時に表示を薄くする要素をサーチするXPath
func: null, // 処理時にそのサイトでのみ実行したい関数があれば書く
titleProcessFunc: null, // 項目名を保存する前に加工したければ関数を書く
autoTranslucentURLRE: //, // 強制的に半透明モードにするURLの正規表現 Web漫画アンテナのマイリスト等
listTitleXPIgnoreNotExist: 0, // 通常listTitleXPにヒットする要素が1つもなくobserveも0なら動作を停止するがこれがtrueだとそれを無視する 項目が動的に追加されるページなどで使用
delay: 0, // ミリ秒 ページ読み込み後処理を開始するまでの遅延
observe: 0, // ミリ秒 1以上だと要素追加ごとにこのミリ秒の遅延を置いて再処理する(とても遅い) 項目が動的に追加されるページなどで使用
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を取り込み、使う ジモティ等、完全に同名の項目名が付けられやすいサイトで使用
useText: 0, // 1なら項目名としてAタグの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サイトなどで使用
observeId: "", // これがあるとobserve有効時に挿入された要素のIDがこれでないものは無視する YouTubeなどの高速化に重要
observeClass: "", // これがあるとobserve有効時に挿入された要素のclassNameがこれでないものは無視する 高速化に重要
helpOnDNI: 0, // 1ならdniでの継ぎ足し時非表示にしたレポートを逐一表示する
disableUrlRE: "", // URLにマッチしたらキー操作の機能を無効にする正規表現 YouTubeなどSPAサイトで動画視聴ページでキー操作の機能を無効にするために使用
},
*/
];
var siteinfo = Object.assign(SITEINFO, pref("MY_SITEINFO") || []); //alert(siteinfo);return;
// thissiteを決定
var thissite = null;
for (var i = 0; i < siteinfo.length; i++) {
if (siteinfo[i].urlRE == "") break;
if (location.href.match(siteinfo[i].urlRE)) {
thissite = i;
var SITE = Object.create(siteinfo[thissite]);
if ((SITE.detailTitleSearchXP || "").indexOf("***") == -1 && (SITE.listTitleSearchXP || "").indexOf("***") == -1 && (SITE.listTitleMemoSearchXP || "").indexOf("***") == -1) SITE.disableKeyB = 1;
break;
}
}
if (thissite === null || (!ENABLE_EXCEPT_YAJ && SITE.id != "YAJ2")) return;
let ENABLE_HELP_CONCLUSION = SITE.disableHelpForce ? 0 : ENABLE_HELP;
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 + "
" + memo, 0, 2);
if (isExist.length == 0) {
if (title && memo) {
let tmp = pref('YAJ2 : SearchMyMemo') || [];
tmp.push({ t: title, m: memo, c: COLORCPUSCORE })
pref('YAJ2 : SearchMyMemo', tmp)
}
}
}
}
pref("lastItemName", "");
//popup3("Task completed");
}, 500);
//return;
}
if (location.href.indexOf("userbenchmark.com") != -1) {} else {
pref("lastItemName") ? (pref("lastItemName", ""), popup3("UBM Task has been cleared")) : 0;
}
// GM_設定を前バージョンから引き継ぐ
if (pref(SITE.id + 'SearchHideTitle') && !pref(SITE.id + ' : SearchHideTitle')) {
pref(SITE.id + ' : SearchHideTitle', pref(SITE.id + 'SearchHideTitle'));
pref(SITE.id + 'SearchHideTitle', "");
}
if (pref(SITE.id + 'SearchMyMemo') && !pref(SITE.id + ' : SearchMyMemo')) {
pref(SITE.id + ' : SearchMyMemo', pref(SITE.id + 'SearchMyMemo'));
pref(SITE.id + 'SearchMyMemo', "");
}
if (pref(SITE.id + 'SearchHideTitle') && pref(SITE.id + ' : SearchHideTitle')) {
pref(SITE.id + 'SearchHideTitle', "");
}
if (pref(SITE.id + 'SearchMyMemo') && pref(SITE.id + ' : SearchMyMemo')) {
pref(SITE.id + 'SearchMyMemo', "");
}
if (SITE.reloadWhenUrlHasChanged) {
var observeUrlHasChangedhref = location.href;
var observeUrlHasChanged = new MutationObserver(mutations => { if (observeUrlHasChangedhref !== location.href) location.reload() });
observeUrlHasChanged.observe(document, { childList: true, subtree: true });
}
// 詳細画面か?
var isDetail = (SITE.detailURLRE && location.href.match(SITE.detailURLRE)) ? 1 : 0;
dc("isDetail : " + isDetail)
// ヤフオク上限価格はIME offにする
if (SITE.id == "YAJ2") $(eleget0('//input[@class="InputText__input" and @name="max"]')).css('ime-mode', 'inactive');
// ヤフオクは「画像を大きく」モードでは効かない
if (SITE.id == "YAJ2" && !isDetail && eleget0('//span[@class="Option__mode Option__mode--gridCurrent"]')) {
popup2("「ヤフオクで非表示とメモ」は「タイトルと画像」表示でのみ働きます");
return;
}
// 自動的に半透明モードにするページ
var disableHide = (SITE.autoTranslucentURLRE && location.href.match(SITE.autoTranslucentURLRE)) || (pref("translucent") == "on");
// 非対応ページ
if (!isDetail && SITE.listTitleXP && !eleget0(SITE.listTitleXP)) {
if (!(SITE.listTitleXPIgnoreNotExist) && !(SITE.observe)) {
if (debug2) popup3("対象要素がないのでこのページでは働きません");
return;
}
}
if (SITE.necessaryToWork && (document.body.innerText.match(SITE.necessaryToWork)) == null) { //prompt(document.body.innerText,document.body.innerText.match(SITE.necessaryToWork))
if (debug2) popup3("非対応ページなのでこのページでは働きません");
return;
}
String.prototype.replaceTitle = function(title) {
if (title && SITE.titleProcessFunc) title = SITE.titleProcessFunc(title);
if (!title) title = "空の文字列";
return this.replace(/\*\*\*/g, "contains(text(),\"" + title + "\")").replace(/\+\+\+/g, "text()=\"" + title + "\"").replace(/\*\*alt\*\*/g, "@alt=\"" + title + "\"").replace(/\*\*title\*\*/g, "@title=\"" + title + "\"").replace(/\+\+url\+\+/g, "@href=\"" + title + "\"");
};
// var keyListen=document.addEventListener('keydown', function(e) {
var keyListen = function(e) {
if (SITE.disableUrlRE && (location.href.match(SITE.disableUrlRE))) { return; }
if (/input|textarea/i.test(e.target.tagName) == false) {
var key = (e.shiftKey ? "Shift+" : "") + (e.altKey ? "Alt+" : "") + (e.ctrlKey ? "Ctrl+" : "") + e.key;
if (key === KEYHIDE) { // Q::hide
e.preventDefault();
if (SITE.hideSelectedWord) { // 選択された文字列をNG / 5ch等
let sel = String(window.getSelection());
if (sel) {
if (sel.indexOf("\n") !== -1) { popup2("複数行の選択は NG に入れられません", 1); } else { addNG(sel); }
if (SITE.funcB) SITE.funcB();
return false;
}
}
// var ele = (SITE.detailTitleXP && isDetail) ? eleget0(SITE.detailTitleXP) : document.elementFromPoint(mousex, mousey);
// var ele = (SITE.detailTitleXP && isDetail) ? (eleget0(SITE.detailTitleXP, document.elementFromPoint(mousex, mousey)) || eleget0(SITE.detailTitleXP)) : document.elementFromPoint(mousex, mousey);
if (SITE.listTitleXP2) { // 2つ目の項目名がありそこにホバーしていればそれで非表示登録
var ele = document.elementFromPoint(mousex, mousey);
if (elegeta(SITE.listTitleXP2).indexOf(ele) != -1) {
hideByTitle(ele.innerText);
addNG(ele.innerText);
return false;
}
}
var ele = (SITE.detailTitleXP && isDetail) ? (eleget0(SITE.detailTitleXP, (SITE.detailRangeFunc ? SITE.detailRangeFunc(document.elementFromPoint(mousex, mousey)) : document.elementFromPoint(mousex, mousey))) || eleget0(SITE.detailTitleXP)) : document.elementFromPoint(mousex, mousey);
dc("Q start element : " + ele.tagName);
blockElement(ele);
if (SITE.funcQ) SITE.funcQ();
return false;
}
if (key == KEYUNDO) { // W::undo
e.preventDefault();
let resist = pref(SITE.id + ' : SearchHideTitle') || [];
let title = resist.pop();
let title2 = resist.slice(-1)[0] || "";
if (title2) title2 = "。次のアンドゥ対象は
『" + title2 + "』";
pref(SITE.id + ' : SearchHideTitle', resist) || [];
showByTitle(title);
if (isDetail && SITE.showFunc) SITE.showFunc();
if (title) popup2("『" + title + "』
を非表示登録から削除しました" + 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();
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") 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(KEYEDIT + ":\n非表示にするタイトル(現在" + (pref(SITE.id + ' : SearchHideTitle') || []).length + ")をJSON形式で編集してください\n正規表現ではありません\n空欄を入力すれば全削除できます\n\n" + sht, sht);
if (tmp !== null) { // ESCで抜けたのでなければ
pref(SITE.id + ' : SearchHideTitle', tmp || "")
prefRestrict(SITE.id + ' : SearchHideTitle', "array");
document.body.remove();
location.reload();
}
return false;
}
if (key == KEYMEMO1) { // 1memo
e.preventDefault();
// var ele = eleget0(SITE.detailTitleXP) ? eleget0(SITE.detailTitleXP) : document.elementFromPoint(mousex, mousey);
var ele = (SITE.detailTitleXP && isDetail) ? (eleget0(SITE.detailTitleXP, (SITE.detailRangeFunc ? SITE.detailRangeFunc(document.elementFromPoint(mousex, mousey)) : document.elementFromPoint(mousex, mousey))) || eleget0(SITE.detailTitleXP)) : document.elementFromPoint(mousex, mousey);
memoElement(ele, document);
return false;
}
if (key == KEYMEMO2) { // 2memo
e.preventDefault();
// var ele = eleget0(SITE.detailTitleXP) ? eleget0(SITE.detailTitleXP) : document.elementFromPoint(mousex, mousey);
var ele = (SITE.detailTitleXP && isDetail) ? (eleget0(SITE.detailTitleXP, (SITE.detailRangeFunc ? SITE.detailRangeFunc(document.elementFromPoint(mousex, mousey)) : document.elementFromPoint(mousex, mousey))) || eleget0(SITE.detailTitleXP)) : document.elementFromPoint(mousex, mousey);
memoElement(ele, document, COLOR2);
return false;
}
if ((key == KEYMEMO1S || key == KEYMEMO2S)) { // 34 free memo
e.preventDefault();
var target = (prompt("メモを付けたい項目のタイトルが含むキーワードを入力してください") || "").trim();
if (!target) return;
var memo = (prompt("『" + target + "』\nに付けるメモを書いてください") || "").trim();
if (!memo) return;
storeMemo(target.trim(), memo, key == KEYMEMO1S ? COLOR1 : COLOR2)
return false;
}
if (key == KEYRESETMEMO) { // reset memo
e.preventDefault();
prefRestrict(SITE.id + 'SearchMyMemo', "array");
let smm = JSON.stringify(pref(SITE.id + ' : SearchMyMemo') || []);
if (smm === '[]') smm = "";
let tmp = prompt(KEYRESETMEMO + ":\nメモ(現在" + (pref(SITE.id + ' : SearchMyMemo') || []).length + ")をJSON形式で編集してください\n空欄を入力すれば全削除されます\n\n" + smm, smm);
if (tmp !== null) { // ESCで抜けたのでなければ
pref(SITE.id + ' : SearchMyMemo', tmp || []);
prefRestrict(SITE.id + 'SearchMyMemo', "array");
document.body.remove();
location.reload();
}
return false;
}
if (key == KEYRESETMEMOAUTO) { // reset automemo
e.preventDefault();
var str = pref(SITE.id + ' : SearchMyMemo') || [];
if (alsoClearBenchMemoWhenClearAutoMemo) {
var newstr = str.filter(e => !(e.c == COLOR3 || e.c == COLORCPUSCORE)); // CPUスコアもリセット
var newstr2 = str.filter(e => (e.c == COLOR3 || e.c == COLORCPUSCORE)); // CPUスコアもリセット
} else {
var newstr = str.filter(e => !(e.c == COLOR3));
var newstr2 = str.filter(e => (e.c == COLOR3));
}
if (confirm(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 (SITE.maxpriceXP && !isDetail) {
if (key == KEYMAXP) { // maxpriceXP
e.preventDefault();
let ele = eleget0(SITE.maxpriceXP);
if (ele) {
ele.focus();
ele.scrollIntoView({ behavior: "smooth", block: "center", inline: "center" });
ele.select();
popup2("上限価格にフォーカス", 1);
}
}
return false;
}
}
}
document.addEventListener('keydown', keyListen, false)
document.addEventListener("mousemove", function(e) {
mousex = e.clientX;
mousey = e.clientY;
}, false);
// AP継ぎ足しを監視
setTimeout(() => { run() }, SITE.delay || 0);
document.body.addEventListener('AutoPagerize_DOMNodeInserted', function(evt) { run(evt.target, "APed"); }, false);
// DOM追加を監視
var DNIDelay = null;
if (!isDetail && SITE.observe) {
dc("observe DNI");
document.body.addEventListener('DOMNodeInserted', dnifunc, false);
document.body.addEventListener('transitionend', dnifunc, false);
function dnifunc(e) {
if (DNIDelay) return;
if (SITE.observeId && e.target.id !== SITE.observeId) return;
//if( SITE.observeClass && e.target.className !== SITE.observeClass) return;
if (e.target.className === "phov" || e.target.id === "yhmbox") return;
DNIDelay = setTimeout(() => {
run(document.body, "observed");
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 (document[hidden]) {} else {
restoreHidden();
}
}
}
// タブにフォーカスが戻った時等用 隠していた要素のうち非表示登録から外されたものを再表示
function restoreHidden() {
if (isDetail) { showByTitle(eleget0(SITE.detailTitleXP).textContent.replaceTitle()); } else {
let resist = pref(SITE.id + ' : SearchHideTitle') || [];
for (let ele of elegeta('//*[@data-hidden="1"]')) {
let title = getTitleFromParent(ele);
if (SITE.titleProcessFunc) title = SITE.titleProcessFunc(title);
let i = resist.indexOf(title); // ここは常に全体一致判定なのでcontains判定のサイトでは少し余計に再表示してしまう(でもまたすぐ隠す)
if (i === -1) {
showByTitle(title);
dc(title + "は再表示")
}
}
}
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;
}
}
}
}
function run(node = document.body, runmode = "1st") { // 1st observed returned
sw("reset");
sw("run");
// サイトごとの個別処理
if (SITE.func) { SITE.func(node); }
// ホバー時の操作案内のポップアップを登録
// if (ENABLE_HELP_CONCLUSION) {
if (ENABLE_HELP_CONCLUSION && !(SITE.disableUrlRE && (location.href.match(SITE.disableUrlRE)))) {
// var lh = (!isDetail && SITE.helpInBlock) ? $("Q:非表示 W:アンドゥ 1:○メモ 2:×メモ") : $("Q:非表示 W:アンドゥ 1:○メモ 2:×メモ");
var lh = (!isDetail && SITE.helpInBlock) ? $("Q:非表示 W:アンドゥ 1:○メモ 2:×メモ") : $("Q:非表示 W:アンドゥ 1:○メモ 2:×メモ");
// var lh2 = (!isDetail && SITE.helpInBlock) ? $("Q:非表示 W:アンドゥ") : $("Q:非表示 W:アンドゥ");
var lh2 = $("Q:非表示 W:アンドゥ");
// 画面全体=詳細画面の方
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");
} 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(SITE.listHelpJQS || elegeta(SITE.listHelpXP || (SITE.listTitleXP ? SITE.listTitleXP + "/../.." : undefined))).add(SITE.listTitleXP2 ? elegeta(SITE.listTitleXP2) : []).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(SITE.listHelpJQS || elegeta(SITE.listHelpXP || (SITE.listTitleXP ? SITE.listTitleXP + "/../.." : undefined))).off("mouseenter mouseleave").hover(function() { lh.appendTo(SITE.helpInBlock ? this : document.body).click(function() { $(this).fadeOut(100).queue(function() { $(this).remove() }) }); }, function() { $(".phov").remove() });
$(node).find(elegeta(SITE.listHelpXP2 || (SITE.listTitleXP2 ? SITE.listTitleXP2 + "/../.." : undefined))).off("mouseenter mouseleave").hover(function() { lh2.appendTo(document.body).click(function() { $(this).fadeOut(100).queue(function() { $(this).remove() }) }); }, function() { $(".phov").remove() });
} 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(SITE.listHelpJQS || elegeta(SITE.listHelpXP || (SITE.listTitleXP ? SITE.listTitleXP + "/../.." : undefined))).add(SITE.listTitleXP2 ? elegeta(SITE.listTitleXP2) : []).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(SITE.listHelpJQS || elegeta(SITE.listHelpXP || (SITE.listTitleXP ? SITE.listTitleXP + "/../.." : undefined))).off("mouseenter mouseleave").hover(function() { lh.appendTo(SITE.helpInBlock ? this : document.body).click(function() { $(this).fadeOut(100).queue(function() { $(this).remove() }) }); }, function() { $(".phov").remove() });
$(node).find(elegeta(SITE.listHelpXP2 || (SITE.listTitleXP2 ? SITE.listTitleXP2 + "/../.." : undefined))).off("mouseenter mouseleave").hover(function() { lh2.appendTo(document.body).click(function() { $(this).fadeOut(100).queue(function() { $(this).remove() }) }); }, function() { $(".phov").remove() });
}
sw("1gyou help");
}
}
// メモ貼りを実行
if (runmode === "observed" || runmode === "returned") {
sw("reset");
$('span[data-mbt="1"]').remove();
sw("removing memo");
}
if (pref(SITE.id + ' : SearchMyMemo')) {
// pref(SITE.id + ' : SearchMyMemo').sort(function(a, b) { return (window.navigator.userAgent.toLowerCase().indexOf('chrome') == -1) ? (a.c == COLORCPUSCORE && b.c !== COLORCPUSCORE ? 1 : 0) : (a.c != COLORCPUSCORE && b.c == COLORCPUSCORE ? -1 : 0); });sw("sorting memo");
for (let a of pref(SITE.id + ' : SearchMyMemo').sort(function(a, b) {
return (window.navigator.userAgent.toLowerCase().indexOf('chrome') == -1) ? (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");
// 非表示を実行
var help = (KEYHIDE + ":非表示 " + KEYUNDO + ":アンドゥ " + (SITE.disableKeyB ? "" : KEYBW + ":NGワード ") + KEYEDIT + ":NG編集 " + KEYMEMO1 + KEYMEMO2 + ":メモを追加 " + KEYMEMO1S + KEYMEMO2S + ":自由メモ " + KEYRESETMEMO + ":メモを編集 " + KEYRESETMEMOAUTO + ":自動メモのみ全削除 " + KEYTOGGLEtranslucent + ":半透明") + (SITE.wholeHelp || "");
if (pref(SITE.id + ' : SearchHideTitle')) {
var i = 0;
for (let title of pref(SITE.id + ' : SearchHideTitle') || []) {
i += hideByTitle(title, node);
}
if (i) { help = i + "個を非表示にしました
" + help; }
}
// 全体ヘルプを表示
if (ENABLE_HELP_CONCLUSION && (SITE.helpOnDNI || (runmode === "1st" && SITE.listTitleXP)) && !(SITE.disableUrlRE && (location.href.match(SITE.disableUrlRE)))) popup2(help, 1);
sw("block");
// 自動メモを探索&製作
if (isDetail) { for (let t = 0; t < ENABLE_AUTOMEMO; t++) { setTimeout(makeautomemo, 500 + t * 3000); } } //debug&&t>0?popup3( t * t / 2 * 1000,2,1):0; }
function makeautomemo() {
if (ENABLE_AUTOMEMO && SITE.automemoURLRE && (location.href.match(SITE.automemoURLRE))) {
SITE.automemoFunc();
}
}
sw("automemo");
//if(HIGHLIGHT_FOR_GUIDE) $((SITE.listTitleXP?elegeta(SITE.listTitleXP):[]).concat(SITE.listTitleXP2?elegeta(SITE.listTitleXP2):[])).effect("highlight",{"color":"#e0e0ff"},1000);
return;
}
function eletext(ele, xp) {
let e = eleget0(ele);
if (e) debugEle(e);
return e ? e.innerText : "";
}
function autoMemo(re, text) {
let automemotarget = SITE.automemoSearchFunc();
let node = document.body;
let sou = automemotarget.match(re);
if (sou) {
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();
var tmp = pref(SITE.id + ' : SearchMyMemo') || [];
var isExist = tmp.filter(e => e.t == title && e.m == memo);
if (isExist.length == 0) {
if (debug) popup3(memo, 2, 1, 5000);
storeMemo(title, memo, COLOR3, node);
}
return true;
}
return false;
}
function getTitle(x, y) {
var ele = (SITE.detailTitleXP && isDetail) ? eleget0(SITE.detailTitleXP) : document.elementFromPoint(mousex, mousey);
if (!ele) return;
var title = getTitleFromParent(ele);
if (!title) return;
return title;
}
function getTitleFromParent(ele) { // ele要素の親の出品物タイトルを返す
dc("start at : " + ele.innerText);
if (isDetail) return tri((SITE.useText ? ele.textContent.replace(/\|/g, '\|') : ele.title || ele.textContent.replace(/\|/g, '\|') || ele.alt));
for (let i = 0; i < (SITE.listGen); i++) {
dc("go up to now (" + i + ") : " + ele.innerText)
var ele2 = elegeta(SITE.listTitleXP, ele);
dc("length:" + ele2.length)
if (ele2.length === 1 || (SITE.searchAllowLength && ele2.length)) {
dc("href : " + ele2[0].href + "\ntitle : " + tri((ele2[0].title + " \ntextContent : " + ele2[0].textContent.replace(/\|/g, '\|') + " \nalt : " + ele2[0].alt)));
return SITE.useURL ? ele2[0].href : SITE.useText ? 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.match(/\"/)) { popup3("項目名に \" を含むので多分うまく処理できません"); return ""; }
return (SITE.trim) ? str.trim() : str;
}
function memoElement(ele, node, color = COLOR1) { //12 memo
if (!ele) return;
var title = getTitleFromParent(ele);
if (!title) return;
if (SITE.titleProcessFunc) title = SITE.titleProcessFunc(title);
if (!title) return;
var memo = (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') || [];
tmp.push({ t: title, m: memo, c: color })
pref(SITE.id + ' : SearchMyMemo', tmp)
memoByTitle(title, memo, node, color);
}
}
function memoByTitle(title, memo, node, color) {
if (title.indexOf('"') != -1) return; // todo:タイトルに"があると正しく検索できないので処理しない
var xp = SITE.listTitleMemoSearchXP.replaceTitle(title);
for (let titleEle of elegeta(xp, node)) {
if (titleEle) {
let ele = SITE.listTitleMemoSearchXPSameGen ? titleEle.parentNode.insertBefore(document.createElement("span"), titleEle.nextSibling) : titleEle.parentNode.parentNode.insertBefore(document.createElement("span"), titleEle.parentNode.nextSibling);
let isCPU = memo.match(/Pentium|Celeron|Core\s?i\d|Ryzen|GHz|AMD.*APU/i);
ele.dataset.mbt = "1";
// ele.innerHTML = '' + memo + '';
ele.innerHTML = '' + memo + '';
$(ele).hide().fadeIn(SITE.observe ? 0 : 150);
// CPUモデルナンバーを右クリックでuserbenchmark検索
if (isCPU) {
$(ele).appendTo($(ele)).on('contextmenu', (function(title, memo) {
return function() {
if (pref("lastItemName") == undefined) { // 前回の処理が終わってないとだめ
pref("lastItemName", title);
popup3(title);
memo = memo.replace(/[\u30a0-\u30ff\u3040-\u309f\u3005-\u3006\u30e0-\u9fcf\s]+/g, "+");
window.open("https://duckduckgo.com/?q=!ducky+" + memo + "+userbenchmark");
setTimeout(() => {
if (pref("lastItemName")) {
popup3("Investigating " + memo + " timed out");
pref("lastItemName", "");
}
}, 30000); // 30秒以内に見ないとだめ
}
return false;
}
})(title, memo));
}
setRemoveMemo(ele, title, memo, color)
}
}
}
function setRemoveMemo(ele, title, memo, color) { // メモをクリックで消す処理
ele.onclick = (e) => {
pref(SITE.id + ' : SearchMyMemo', (pref(SITE.id + ' : SearchMyMemo') || []).filter(n => !(n.t == title && n.m == memo && n.c == color)))
for (let e of elegeta('//span[@class="' + escape(title + memo + color) + '"]')) $(e).hide(200).queue(function() { $(this.parentNode).remove() }); //e.remove(); //ele.remove();
e.preventDefault();
e.stopPropagation();
}
}
function blockElement(ele) { //Q:: toggle
if (!ele) return;
var title = getTitleFromParent(ele);
dc("got : " + title)
addNG(title);
}
function hideByTitle(title, node) {
let i = 0;
if (!isDetail || SITE.hideListEvenDetail) {
let resHit = [];
if (SITE.listTitleSearchFunc) resHit = SITE.listTitleSearchFunc(title); // 主に5ch用、レス中キーワードNG
// 1項目ずつ
for (let ele of typeof title === "object" ? [title] : elegeta(SITE.listTitleSearchXP.replaceTitle(title), node).concat(resHit)) { // titleがテキストなら項目タイトルにヒットする要素、DOM要素なら直接それを隠す
// 1項目ずつ
// for (let ele of typeof title === "object" ? [title] : elegeta(SITE.listTitleSearchXP.replaceTitle(title), node)) { // titleがテキストなら項目タイトルにヒットする要素、DOM要素なら直接それを隠す
i++;
ele.dataset.hidden = "1";
if (!disableHide) {
$(ele).fadeOut(34);
} else {
ele.style.opacity = "0.75";
setTimeout(function() { ele.style.opacity = "0.50" }, 17 * 1);
}
}
}
if (isDetail) {
// 詳細:画面全体
if (isDetail && SITE.detailTitleXP && SITE.detailTitleSearchXP) {
var xp = SITE.detailTitleSearchXP.replaceTitle(title) // isearでハイライトされていると×
for (let ele of elegeta(xp, node)) {
dc(xp, ele, ele.textContent);
i++;
ele.style.opacity = "0.5";
}
}
}
return i;
}
function showByTitle(title) {
if (!isDetail || SITE.hideListEvenDetail) {
let resHit = [];
if (SITE.listTitleSearchFunc) resHit = SITE.listTitleSearchFunc(title);
// 1項目ずつ
var xp = SITE.listTitleSearchXP.replaceTitle(title);
for (let ele of elegeta(xp).concat(resHit)) {
$(ele).fadeIn(34);
delete ele.dataset.hidden;
setTimeout(function() { ele.style.opacity = "1" }, 17 * 2);
}
}
if (isDetail) {
// 詳細:画面全体
if (isDetail && SITE.detailTitleXP && SITE.detailTitleSearchXP) {
var xp = SITE.detailTitleSearchXP.replaceTitle(title) // isearでハイライトされていると×
for (let ele of elegeta(xp)) { ele.style.opacity = "1"; }
}
}
}
function addNGWord() {
var newWord = (prompt("非表示にしたい項目のタイトルが含むNGワードを入力してください\n\n現在の全体\n" + JSON.stringify(pref(SITE.id + ' : SearchHideTitle') || []) + "\nに追加されます\n\n") || "").trim();
addNG(newWord);
}
function addNG(title) {
if (!title) return;
if (SITE.titleProcessFunc) title = SITE.titleProcessFunc(title);
if (!title) return;
let resist = pref(SITE.id + ' : SearchHideTitle') || [];
let i = resist.indexOf(title);
if (i !== -1) {
resist.splice(i, 1);
pref(SITE.id + ' : SearchHideTitle', resist);;
popup2("『" + title + "』
を非表示登録から削除しました", 1);
showByTitle(title);
if (isDetail && SITE.showFunc) SITE.showFunc();
} else {
resist.push(title);
pref(SITE.id + ' : SearchHideTitle', resist);
popup2("『" + title + "』
を非表示登録しました(" + KEYUNDO + ":取り消し " + KEYEDIT + ":編集)", 1);
hideByTitle(title);
}
}
// キャッシュ付き
var elegetaCacheXP = "";
var elegetaCacheLastTime = new Date();
var elegetaCacheResult = [];
var elegetaCacheNode = "";
var ehit = 0;
var emiss = 0;
function elegeta(xpath, node = document) {
if (!xpath) return [];
if (xpath === elegetaCacheXP && node === elegetaCacheNode && ((new Date().getTime() - elegetaCacheLastTime) < 100)) {
//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);
for (var i = 0; i < ele.snapshotLength; i++) array[i] = ele.snapshotItem(i);
elegetaCacheResult = array;
return array;
} catch (e) { popup2(e + "
" + xpath, 1); return []; }
}
function eleget0(xpath, node = document) {
if (!xpath) return null;
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 + "
" + xpath, 1); return null; }
}
function popup3(text, i = 0, lf = 1, timer = 5000, alignY = "bottom") {
if (!ENABLE_HELP_CONCLUSION) return;
if (text == undefined) return;
if (typeof text == "string") text = text.slice(0, 100);
let id = Math.random().toString(36).substring(2);
let ele = document.body.appendChild(document.createElement("span"));
ele.outerHTML = '' + text + '';
maey += lf + 1;
if (typeof text == "string") { maey += (text.match(/
/gmi) || []).length || 0; } //console.log((text.match(/
/gmi) || [] ).length) }
setTimeout(() => {
eleget0('//span[@id="yhmbox' + id + '"]').remove();
maey = 0;
}, timer);
}
var maet;
function popup2(text, i = 0) {
if (!ENABLE_HELP_CONCLUSION) return;
var mae = eleget0('//span[@id="yhmbox"]');
if (maet && mae) {
mae.remove();
clearTimeout(maet);
}
let bgcol = (pref("translucent") != "on") ? "#6080ff" : "#909090";
var ele = $('' + 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 debugEle(ele, force = "") {
if (ENABLE_HELP_CONCLUSION && (debug || force == "force")) {
let col = getColorFromText(ele.innerText);
// let 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+'"';
}
}
function advertiseEle(ele, force = "") {
if (debug || force == "force") {
if (ele) ele.style.outline = "4px dotted red";
}
}
function getColorFromText(str) {
var col = 0;
for (letter of str) { col = (col + str.charCodeAt(letter) * 2097152) % 0xffffff; }
return '#' + (0x1000000 + col).toString(16).substr(1, 6);
}
function sw(job) {
if (ENABLE_MEASURE_TIME_SPENT == 0) return;
if (job !== "reset") dc(job + " : " + ((new Date().getTime()) - (swb.getTime())) + " ms");
swb = new Date();
}
function isSeller() {
return location.href.match(/\/seller\//);
}
function dc(str) {
if (debug >= 1) console.log(str);
if (debug >= 2) popup3(str, 0, 1, 5000, "top");
return str;
}
})();