From aca515059b389a1af58d21bbea46acecd707bb0a Mon Sep 17 00:00:00 2001 From: magnolia1234 <7676006-magnolia1234@users.noreply.gitlab.com> Date: Sat, 19 Aug 2023 07:42:37 +0200 Subject: [PATCH] Update custom sites (add_ext_link: Google Search Tool) --- README.md | 2 +- background.js | 2 +- changelog.txt | 1 + contentScript.js | 7 +++++++ custom/manifest.json | 2 +- custom/sites_custom.json | 6 ++++++ manifest.json | 2 +- options/options_custom.js | 6 +++--- 8 files changed, 21 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0c1fc69..071fa28 100644 --- a/README.md +++ b/README.md @@ -960,7 +960,7 @@ Remember to check the [previous requests](https://gitlab.com/magnolia1234/bypass 3. Disable Javascript on the site (by browser, uBlock Origin or other add-on). 4. Add the domain as custom site for more bypass options. 5. Open page in reader view (by browser or add-on). -6. Try one of the archive sites. +6. Try one of the archive sites (for Google Search Tool test url & copy html (tab) code to https://codebeautify.org/htmlviewer or https://html.onlineviewer.net). ### Add custom site Add your own custom site (also for testing). diff --git a/background.js b/background.js index b7a286c..c57b2e6 100644 --- a/background.js +++ b/background.js @@ -432,7 +432,7 @@ ext_api.storage.local.get({ var sites_default = items.sites_default; customSites = items.sites_custom; customSites = filterObject(customSites, function (val, key) { - return !(val.add_ext_link && (!val.add_ext_link_type || val.add_ext_link_type === 'google_search_tool')) + return !(val.add_ext_link && !val.add_ext_link_type) }); customSites_domains = Object.values(customSites).map(x => x.domain); updatedSites = items.sites_updated; diff --git a/changelog.txt b/changelog.txt index 1420b82..9fa3c7f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -11,6 +11,7 @@ Fix Ksta.de & Rundschau-online.de (json) Fix The Press-Enterprise (new domain) Fix WSJ (remove option to disable Googlebot) Grouping/fix GenomeWeb sites (Crain) +Update custom sites (add_ext_link: Google Search Tool) * v3.2.9.0 (2023-08-13) Add 4 more Lee Enterprises Group sites diff --git a/contentScript.js b/contentScript.js index e3e21bc..ff81b96 100644 --- a/contentScript.js +++ b/contentScript.js @@ -223,6 +223,9 @@ if (bg2csData.add_ext_link) { case 'google_webcache': article.firstChild.before(googleWebcacheLink(url)); break; + case 'google_search_tool': + article.firstChild.before(googleSearchToolLink(url)); + break; } } } @@ -5608,6 +5611,10 @@ function googleWebcacheLink(url, text_fail = 'BPC > Try for full article text:\r return externalLink(['webcache.googleusercontent.com'], 'https://{domain}/search?q=cache:{url}', url, text_fail); } +function googleSearchToolLink(url, text_fail = 'BPC > Full article text (test url & copy html (tab) code to [https://codebeautify.org/htmlviewer] or [https://html.onlineviewer.net]):\r\n') { + return externalLink(['search.google.com'], 'https://search.google.com/test/rich-results?url={url}', encodeURIComponent(url), text_fail); +} + function ext_12ftLink(url, text_fail = 'BPC > Try for full article text:\r\n') { return externalLink(['12ft.io'], 'https://{domain}/{url}', url, text_fail); } diff --git a/custom/manifest.json b/custom/manifest.json index a1a579f..feb3847 100644 --- a/custom/manifest.json +++ b/custom/manifest.json @@ -51,5 +51,5 @@ "webRequestBlocking", "*://*/*" ], - "version": "3.2.9.5" + "version": "3.2.9.6" } diff --git a/custom/sites_custom.json b/custom/sites_custom.json index e7ec6d7..3889853 100644 --- a/custom/sites_custom.json +++ b/custom/sites_custom.json @@ -512,6 +512,12 @@ "block_regex": "\\.thefashionlaw\\.com\\/evolok\\/.+\\/ev-widgets\\.min\\.js", "domain": "thefashionlaw.com" }, + "Theinformation.com": { + "add_ext_link": "div[data-paywall]|div.locked", + "add_ext_link_type": "google_search_tool", + "allow_cookies": 1, + "domain": "theinformation.com" + }, "Themonthly.com.au": { "domain": "themonthly.com.au" }, diff --git a/manifest.json b/manifest.json index 4cbca88..2208b9d 100644 --- a/manifest.json +++ b/manifest.json @@ -789,5 +789,5 @@ "*://*.wyleex.com/*", "*://webcache.googleusercontent.com/*" ], - "version": "3.2.9.5" + "version": "3.2.9.6" } diff --git a/options/options_custom.js b/options/options_custom.js index e1e3e54..126691a 100644 --- a/options/options_custom.js +++ b/options/options_custom.js @@ -9,7 +9,7 @@ var custom_switch = ((manifestData.optional_permissions && manifestData.optional var useragent_options = ['', 'googlebot', 'bingbot', 'facebookbot']; var referer_options = ['', 'facebook', 'google', 'twitter']; var random_ip_options = ['', 'all', 'eu']; -var add_ext_link_type_options = ['', 'archive.is', '12ft.io', 'google_webcache'] +var add_ext_link_type_options = ['', 'archive.is', '12ft.io', 'google_webcache', 'google_search_tool']; function capitalize(str) { return (typeof str === 'string') ? str.charAt(0).toUpperCase() + str.slice(1) : ''; @@ -37,7 +37,7 @@ function save_options() { if (textareaEl.value) { var sites_custom = JSON.parse(textareaEl.value); sites_custom = filterObject(sites_custom, function (val, key) { - return !(val.add_ext_link && (!val.add_ext_link_type || val.add_ext_link_type === 'google_search_tool')) + return !(val.add_ext_link && !val.add_ext_link_type) }); } ext_api.storage.local.set({ @@ -95,7 +95,7 @@ function import_json(result) { sites_custom[site] = sites_custom_new[site]; } sites_custom = filterObject(sites_custom, function (val, key) { - return !(val.add_ext_link && (!val.add_ext_link_type || val.add_ext_link_type === 'google_search_tool')) + return !(val.add_ext_link && !val.add_ext_link_type) }); ext_api.storage.local.set({ sites_custom: sites_custom