chrome branch code up

This commit is contained in:
Amit Nandi 2025-04-04 22:20:54 +05:30
parent 72930c3d65
commit 95a9a99801
50 changed files with 25599 additions and 0 deletions

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020, magnolia1234
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

21
LICENSE.txt Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020, magnolia1234
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

1100
README.html Normal file

File diff suppressed because it is too large Load diff

1239
README.md Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.brave.Browser</key>
<dict>
<key>Forced</key>
<array>
<dict>
<key>mcx_preference_settings</key>
<dict>
<key>ExtensionInstallAllowlist</key>
<array>
<string>lkbebcjgcmobigpeffafkodonchffocl</string>
</array>
</dict>
</dict>
</array>
</dict>
</dict>
<key>PayloadDisplayName</key>
<string>Brave ExtensionInstallAllowlist - add BPC ID to override browser's restriction</string>
<key>PayloadEnabled</key>
<true/>
<key>PayloadIdentifier</key>
<string>com.example.Brave.example.bpc</string>
<key>PayloadType</key>
<string>com.apple.ManagedClient.preferences</string>
<key>PayloadUUID</key>
<string>a5c53548-65aa-11e7-907b-a6006ad3dba0</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDescription</key>
<string>Bypass Paywalls Chrome Clean - Brave</string>
<key>PayloadDisplayName</key>
<string>Brave ExtensionInstallAllowlist for Bypass Paywalls Clean</string>
<key>PayloadIdentifier</key>
<string>com.example.Brave.example.bpc</string>
<key>PayloadOrganization</key>
<string>Bypass Paywalls Chrome Clean</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadScope</key>
<string>User</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>33e27889678746574b5f4882e1d3985764907861895746574f95fa247c6003d0cd</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>

View file

@ -0,0 +1,3 @@
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\BraveSoftware\Brave\ExtensionInstallAllowlist]
"1"="lkbebcjgcmobigpeffafkodonchffocl"

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.google.Chrome</key>
<dict>
<key>Forced</key>
<array>
<dict>
<key>mcx_preference_settings</key>
<dict>
<key>ExtensionInstallAllowlist</key>
<array>
<string>lkbebcjgcmobigpeffafkodonchffocl</string>
</array>
</dict>
</dict>
</array>
</dict>
</dict>
<key>PayloadDisplayName</key>
<string>Chrome ExtensionInstallAllowlist - add BPC ID to override browser's restriction</string>
<key>PayloadEnabled</key>
<true/>
<key>PayloadIdentifier</key>
<string>com.example.Chrome.example.bpc</string>
<key>PayloadType</key>
<string>com.apple.ManagedClient.preferences</string>
<key>PayloadUUID</key>
<string>a5c53548-65aa-11e7-907b-a6006ad3dba0</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDescription</key>
<string>Bypass Paywalls Chrome Clean</string>
<key>PayloadDisplayName</key>
<string>Chrome ExtensionInstallAllowlist for Bypass Paywalls Clean</string>
<key>PayloadIdentifier</key>
<string>com.example.Chrome.example.bpc</string>
<key>PayloadOrganization</key>
<string>Bypass Paywalls Chrome Clean</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadScope</key>
<string>User</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>33e27889678746574b5f4882e1d3985764907861895746574f95fa247c6003d0cd</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>

View file

@ -0,0 +1,3 @@
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallAllowlist]
"1"="lkbebcjgcmobigpeffafkodonchffocl"

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.microsoft.Edge</key>
<dict>
<key>Forced</key>
<array>
<dict>
<key>mcx_preference_settings</key>
<dict>
<key>ExtensionInstallAllowlist</key>
<array>
<string>lkbebcjgcmobigpeffafkodonchffocl</string>
</array>
</dict>
</dict>
</array>
</dict>
</dict>
<key>PayloadDisplayName</key>
<string>MS Edge ExtensionInstallAllowlist - add BPC ID to override browser's restriction</string>
<key>PayloadEnabled</key>
<true/>
<key>PayloadIdentifier</key>
<string>com.example.Edge.example.bpc</string>
<key>PayloadType</key>
<string>com.apple.ManagedClient.preferences</string>
<key>PayloadUUID</key>
<string>a5c53548-65aa-11e7-907b-a6006ad3dba0</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDescription</key>
<string>Bypass Paywalls Chrome Clean - MS Edge</string>
<key>PayloadDisplayName</key>
<string>MS Edge ExtensionInstallAllowlist for Bypass Paywalls Clean</string>
<key>PayloadIdentifier</key>
<string>com.example.Edge.example.bpc</string>
<key>PayloadOrganization</key>
<string>Bypass Paywalls Chrome Clean</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadScope</key>
<string>User</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>33e27889678746574b5f4882e1d3985764907861895746574f95fa247c6003d0cd</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>

View file

@ -0,0 +1,3 @@
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallAllowlist]
"1"="lkbebcjgcmobigpeffafkodonchffocl"

View file

@ -0,0 +1,3 @@
Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist]
"1"="lkbebcjgcmobigpeffafkodonchffocl"

View file

@ -0,0 +1,3 @@
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallForcelist]
"1"="lkbebcjgcmobigpeffafkodonchffocl"

66
allowlist/README.html Normal file
View file

@ -0,0 +1,66 @@
<!DOCTYPE html []>
<html>
<head>
<meta charset="UTF-8" />
<meta name="author" content="MarkdownViewer++" />
<title>README.md</title>
<style type="text/css">
/* Avoid page breaks inside the most common attributes, especially for exports (i.e. PDF) */
td, h1, h2, h3, h4, h5, p, ul, ol, li {
page-break-inside: avoid;
}
</style>
</head>
<body>
<h1 id="add-extension-crx-to-allowlist">Add extension (crx) to allowlist</h1>
<ul>
<li>
<a href="#windows">Windows</a>
</li>
<li>
<a href="#macOS">macOS</a>
</li>
<li>
<a href="#linux">Linux</a>
</li>
</ul>
<h3 id="windows">Windows</h3>
<p>Advance Notice: after adding the allowlist-policy you'll get a message <em>Your browser is managed by your organisation</em> on the extensions page (and some settings like Secure DNS are disabled).<br />
To remove this message you'll have to remove the added policy from the registry again (run regedit and for Chrome check HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome).</p>
<p>If you still want to add the extension to the allowlist:</p>
<p>Run as administrator one of the reg-files in allowlist-folder of extension (unzip).</p>
<ul>
<li>for Edge 116+ you may also need to run the <em>Forcelist</em> reg-file (also undo reg-file provided) or switch to <em>Load unpacked</em> installation.</li>
</ul>
<p>If you already added extensions to the allowlist than you should change "1" to a new value (also change name of HLM-key for beta/developer versions of browsers).<br />
To add more extensions to the allowlist you can add more lines.<br />
Example Chrome-regfile:</p>
<pre>
<code>Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallAllowlist]
"1"="lkbebcjgcmobigpeffafkodonchffocl"
"2"="extension-id2"
</code>
</pre>
<p>You can also run the PowerShell script <em>bypass_paywalls_clean_allowlist.ps1</em> (as administrator) to add extension to the allowlist (script checks if extension already allowed or adds new registry-key).<br />
For the parameter browser enter chrome, edge or brave.</p>
<h3 id="macos">macOS</h3>
<p>Run with admin rights one of the .mobileconfig files in allowlist-folder of extension (unzip).<br />
Finally restart the browser's process (in the Dock: right click on Chrome, 'Quit', reopen).<br />
This assumes your device is not being managed by MDM software and you don't have any profile related to the 'ExtensionInstallAllowlist' policy already active.<br />
To add more extensions to the allowlist you can add more lines.</p>
<pre>
<code>&lt;key&gt;ExtensionInstallAllowlist&lt;/key&gt;
&lt;array&gt;
&lt;string&gt;lkbebcjgcmobigpeffafkodonchffocl&lt;/string&gt;
&lt;string&gt;extension-id2&lt;/string&gt;
&lt;/array&gt;
</code>
</pre>
<h3 id="linux">Linux</h3>
<p>
<a href="https://developer.chrome.com/docs/extensions/mv3/hosting/#hosting">Chromium-based browsers allow local installations of extensions</a>, so not necessary :)</p>
</body>
</html>

46
allowlist/README.md Normal file
View file

@ -0,0 +1,46 @@
# Add extension (crx) to allowlist
* [Windows](#windows)
* [macOS](#macOS)
* [Linux](#linux)
### Windows
Advance Notice: after adding the allowlist-policy you'll get a message *Your browser is managed by your organisation* on the extensions page (and some settings like Secure DNS are disabled).\
To remove this message you'll have to remove the added policy from the registry again (run regedit and for Chrome check HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome).
If you still want to add the extension to the allowlist:
Run as administrator one of the reg-files in allowlist-folder of extension (unzip).
* for Edge 116+ you may also need to run the *Forcelist* reg-file (also undo reg-file provided) or switch to *Load unpacked* installation.
If you already added extensions to the allowlist than you should change "1" to a new value (also change name of HLM-key for beta/developer versions of browsers).\
To add more extensions to the allowlist you can add more lines.\
Example Chrome-regfile:
```
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallAllowlist]
"1"="lkbebcjgcmobigpeffafkodonchffocl"
"2"="extension-id2"
```
You can also run the PowerShell script *bypass_paywalls_clean_allowlist.ps1* (as administrator) to add extension to the allowlist (script checks if extension already allowed or adds new registry-key).\
For the parameter browser enter chrome, edge or brave.
### macOS
Run with admin rights one of the .mobileconfig files in allowlist-folder of extension (unzip).\
Finally restart the browser's process (in the Dock: right click on Chrome, 'Quit', reopen).\
This assumes your device is not being managed by MDM software and you don't have any profile related to the 'ExtensionInstallAllowlist' policy already active.\
To add more extensions to the allowlist you can add more lines.
```
<key>ExtensionInstallAllowlist</key>
<array>
<string>lkbebcjgcmobigpeffafkodonchffocl</string>
<string>extension-id2</string>
</array>
```
### Linux
[Chromium-based browsers allow local installations of extensions](https://developer.chrome.com/docs/extensions/mv3/hosting/#hosting), so not necessary :)

View file

@ -0,0 +1,39 @@
param(
[Parameter(Mandatory=$true)]
[ValidateSet("edge", "chrome", "brave")]
[string]$browser
)
$regPath = switch ($browser) {
"edge" { "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\ExtensionInstallAllowlist" }
"chrome" { "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallAllowlist" }
"brave" { "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Policies\BraveSoftware\Brave\ExtensionInstallAllowlist" }
}
$valueData = "lkbebcjgcmobigpeffafkodonchffocl"
if (Test-Path $regPath) {
$values = Get-ItemProperty $regPath
} else {
New-Item -Path $regPath -ItemType RegistryKey -Force
}
if ($values | Where-Object { $_.PSObject.Properties.Value -eq $valueData} ) {
Write-Host "The value already exists."
} else {
$newValueName = 1
while ($values | Where-Object { $_.PSObject.Properties.Name -eq $newValueName.ToString()} ) {
$newValueName++
}
New-ItemProperty -Path $regPath -Name $newValueName -Value $valueData -PropertyType String
Write-Host "A new value has been added with the name '$newValueName'."
}

2222
background.js Normal file

File diff suppressed because it is too large Load diff

BIN
bypass-dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

BIN
bypass.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

3158
changelog.txt Normal file

File diff suppressed because it is too large Load diff

9389
contentScript.js Normal file

File diff suppressed because it is too large Load diff

237
contentScript_once.js Normal file
View file

@ -0,0 +1,237 @@
//'use strict';
var ext_api = (typeof browser === 'object') ? browser : chrome;
if (matchDomain('gitflic.ru')) {
if (window.location.pathname.startsWith('/project/magnolia1234/bpc_uploads') && document.head) {
let sheet = document.createElement('style');
let path_short = window.location.pathname.replace('/project/magnolia1234/bpc_uploads', '');
if (!path_short)
sheet.innerText = 'div[data-cell-type="commit"], div[data-cell-type="date"] {display: none !important;} div[data-cell-type="filename"] {flex: 0 0 100% !important;}';
else if (path_short.match(/^\/(blob|file)/))
sheet.innerText = 'div.project-files-tree, div.project-files-list {flex: 0 0 50% !important; max-width: 50% !important;}';
if (sheet.innerText)
document.head.appendChild(sheet);
}
}
else {
window.setTimeout(function () {
let hostname = window.location.hostname.replace(/^www\./, '');
let custom_domain = getCookieDomain(hostname);
let group;
if (hostname && ext_api.runtime) {
if (document.querySelector('head > link[href*=".medium.com/"]') || matchDomain(['gitconnected.com', 'plainenglish.io']))
group = 'medium.com';
else if (document.querySelector('head > meta[property="og:image"][content*="beehiiv"]'))
group = '###_beehiiv'; // no fix
else if (document.querySelector('head > meta[name="generator"][content^="Ghost"]') && !document.querySelector('script[src^="https://steadyhq.com/"]'))
group = '###_ghost'; // no fix
else if (document.querySelector('head > link[href*="/leaky-paywall"], script[src*="/leaky-paywall"], div[id^="issuem-leaky-paywall-"]'))
group = '###_wp_leaky_paywall';
else if (document.querySelector('head > link[href^="https://substackcdn.com/"]'))
group = '###_substack_custom'; // no fix
else if (matchDomain(['monitor.co.ug', 'mwananchi.co.tz', 'mwanaspoti.co.tz', 'thecitizen.co.tz']))
group = '###_ke_nation_media';
else if (document.querySelector('head > link[href="//ppt.promedia.nl"]') || document.querySelector('head > script[src*="/pmgnews/scripts/promedia.js"]'))
group = '###_nl_promedia';
else if (hostname.match(/\.com$/) && !matchDomain(['campaignlive.com']) && document.querySelector('span#hmn-logo > a[href="https://www.haymarketmedicalnetwork.com/about"], footer a[href="https://www.haymarketmediaus.com/haymarket-media-inc-privacy-policy/"]'))
group = '###_uk_haymarket_medical';
else if (matchDomain(['asianinvestor.net', 'campaignindia.in', 'taspo.de']) || (hostname.match(/\.co(m|\.uk)$/) && document.querySelector('footer a[href^="http://www.haymarket.com"]')))
group = '###_uk_haymarket';
else if (matchDomain(['epochtimes-romania.com']) || hostname.match(/\.epochtimes\.(com\.br|cz|de|fr|jp)/))
group = '###_usa_epochtimes';
else if (hostname.match(/\.(com|net)\.au$/) && !matchDomain(['insideretail.com.au'])) {
if (document.querySelector('a[href^="https://austcommunitymedia.my.site.com/"]'))
group = '###_au_comm_media';
else if (hostname.endsWith('.com.au')) {
if (document.querySelector('head > link[href="https://images.thewest.com.au"]'))
group = 'thewest.com.au';
else if (document.querySelector('head > link[rel="dns-prefetch"][href="//static.ew.mmg.navigacloud.com"]'))
group = '###_au_mmg';
else if (document.querySelector('div.c-footer__copyright > a[href^="https://nemedia.com.au"]'))
group = '###_au_nomedia'; // no fix
else if (hostname.match('farmingahead.com.au'))
group = '###_uk_aspermont'; // no fix
}
} else if (hostname.endsWith('.cl')) {
if (document.querySelector('head > meta[property="og:image"][content*="/impresa.soy-chile.cl/"]'))
group = 'elmercurio.com';
} else if (hostname.match(/\.(de|at|ch)$/) || matchDomain(['horizont.net', 'lebensmittelzeitung.net'])) {
if (document.querySelector('head > script[src*="/dfv.containers.piwik.pro/"]'))
group = '###_de_dfv_medien';
else if (hostname.endsWith('.de')) {
if (document.querySelector('div.navigation__personalization > a[href^="https://www.haas-mediengruppe.de/"]'))
group = '###_de_haas_medien';
else if (document.querySelector('head > link[href*=".rndtech.de/"]'))
group = '###_de_madsack';
else if (document.querySelector('a.mgw-logo[href^="https://mgw.de"]'))
group = '###_de_mgw';
else if (matchDomain(['buerstaedter-zeitung.de', 'hochheimer-zeitung.de', 'lampertheimer-zeitung.de', 'lauterbacher-anzeiger.de', 'main-spitze.de', 'mittelhessen.de', 'oberhessische-zeitung.de', 'wormser-zeitung.de']))
group = '###_de_vrm';
else if (matchDomain('finanzbusiness.de'))
group = '###_dk_watch_media'; // custom
else if (matchDomain('schwaebische-post.de') || document.querySelector('header a[href^="https://www.ippen.media"]'))
group = '###_de_ippen_media';
} else if (hostname.endsWith('.ch')) {
if (document.querySelector('head > link[href*="/assets.static-chmedia.ch/"]'))
group = '###_ch_media';
else if (document.querySelector('div#__next > div.page-section li > a[href^="https://jobs.tamedia.ch/"]'))
group = '###_ch_tamedia';
}
} else if (hostname.endsWith('.dk')) {
if (matchDomain(['doi.dk']) || document.querySelector('div#footer > div.row > div.col > a[href="https://www.dkmedier.dk"]'))
group = '###_dk_medier';
else if (hostname.endsWith('watch.dk') && document.querySelector('head > link[as="image"][imagesrcset^="https://photos.watchmedier.dk/"]'))
group = '###_dk_watch_media'; // custom
} else if (hostname.match(/\.(es|cat)$/) || matchDomain(['diariocordoba.com', 'elperiodicodearagon.com', 'elperiodicoextremadura.com', 'elperiodicomediterraneo.com', 'emporda.info'])) {
if (document.querySelector('head > link[href*="/estaticos-cdn."]'))
group = '###_es_epiberica';
else if (document.querySelector('div > ul > li > a[href="https://www.sportlife.es/"]'))
group = '###_es_sport_life';
} else if (hostname.endsWith('.fi')) {
if (document.querySelector('head > link[href^="https://assets.almatalent.fi"]'))
group = '###_fi_alma_talent'; // no fix
else if (document.querySelector('head[prefix*=".kalevamedia.fi/"]'))
group = '###_fi_kaleva'; // no fix
} else if (hostname.endsWith('.fr')) {
if (document.querySelector('head > meta[name="google-play-app"][content^="app-id=com.centrefrance"]'))
group = '###_fr_gcf';
else if (matchDomain(['cahiers-techniques-batiment.fr', 'lemoniteur.fr', 'lsa-conso.fr']))
group = '###_fr_groupe_infopro';
} else if (hostname.endsWith('.it')) {
if (document.querySelector('head > link[href^="//citynews.stgy.ovh/"]'))
group = '###_it_citynews'; // no fix
else if (matchDomain(['gazzettadimodena.it', 'gazzettadireggio.it', 'lanuovaferrara.it']))
group = '###_it_gruppo_sae';
} else if (hostname.endsWith('.nl')) {
if (document.querySelector('head > link[href*=".ndcmediagroep.nl/"]'))
group = '###_nl_mediahuis_noord';
else if (document.querySelector('head > link[rel="dns-prefetch"][href^="https://vmn-"][href$="imgix.net"]'))
group = '###_nl_vmnmedia'; // no fix
} else if (hostname.endsWith('.no')) {
if (hostname.endsWith('watch.no') && document.querySelector('head > link[as="image"][imagesrcset^="https://photos.watchmedier.dk/"]'))
group = '###_dk_watch_media'; // custom
} else if (hostname.endsWith('.se')) {
if (document.querySelector('footer > div > div > a[href="https://www.nwtmedia.se/"]'))
group = '###_se_nwt_media';
else if (document.querySelector('footer ul > li > a[href^="https://privacy.bonniernews.se/cookiepolicy"]'))
group = '###_se_bonnier_group';
else if (document.querySelector('head > link[href^="https://cdn.gotamedia.se/"]'))
group = '###_se_gota_media'; // no fix
} else if (hostname.match(/\.(co\.uk|scot)$/)) {
if (matchDomain(['motortransport.co.uk']))
group = '###_uk_dvv_media';
else if (document.querySelector('footer > div a[href^="https://www.nationalworldplc.com"]'))
group = '###_uk_nat_world';
else if (document.querySelector('footer li > a[href^="https://www.newsquest.co.uk/"]'))
group = '###_uk_newsquest';
else if (document.querySelector('div#wrbm-footer-div'))
group = '###_uk_william_reed';
else if (matchDomain(['footballleagueworld.co.uk']))
group = '###_ca_valnet';
} else if (hostname.match(/\.(ca|com|net|news|org)$/)) {
if (matchDomain(['latribune.ca', 'lavoixdelest.ca', 'ledroit.com', 'lenouvelliste.ca', 'lequotidien.com']))
group = '###_ca_gcm';
else if (matchDomain(['montrealgazette.com']) || document.querySelector('head > script[src*=".postmedia.digital/"], head > meta[content*=".postmedia.digital/"]'))
group = '###_ca_postmedia';
else if (document.querySelector('div.asp_logo > a > img[src$="aspermont.png"]'))
group = '###_uk_aspermont'; // no fix
else if (document.querySelector('head > script[src*=".axate.io/"], head > script[src*=".agate.io/"]'))
group = '###_uk_axate.io';
else if (matchDomain(['flightglobal.com', 'freightcarbonzero.com', 'heavyliftpfi.com', 'personneltoday.com', 'railwaygazette.com']))
group = '###_uk_dvv_media';
else if (document.querySelector('footer li > a[href^="https://www.newsquest.co.uk/"]'))
group = '###_uk_newsquest';
else if (document.querySelector('div#wrbm-footer-div'))
group = '###_uk_william_reed';
else if (document.querySelector('head > script[src="https://cdn.blueconic.net/bridgetowermedia.js"], header.site-header > div.btm-header'))
group = '###_usa_bridge_tower';
else if (document.querySelector('head > script[type][src*="-cnhi-pw.newsmemory.com"]'))
group = '###_usa_cnhi';
else if (document.querySelector('footer#footer li > a[href^="https://cherryroad-media.com"]'))
group = '###_usa_cherryroad'; // no fix
else if (document.querySelector('head > link[href*=".gannettdigital.com/"], head > link[href*=".gannett-cdn.com/"]'))
group = '###_usa_gannett';
else if (document.querySelector('head > script[src*="/treg.hearstnp.com/"]'))
group = '###_usa_hearst_comm';
else if (document.querySelector('head > script[src*=".townnews.com/leetemplates.com/'))
group = '###_usa_lee_ent';
else if (document.querySelector('head > meta[name="tncms-access-version'))
group = '###_usa_townnews';
else if (document.querySelector('section.bottom-nav > a[href^="https://www.mcclatchy.com/privacy-policy"]'))
group = '###_usa_mcc';
else if (document.querySelector('head > link[rel="stylesheet"][id^="dfm-accuweather-"], footer li > a[href^="https://www.medianewsgroup.com"]'))
group = '###_usa_mng';
else if (hostname.match(/\.com$/)) {
if (document.querySelector('div.footer-note > div.text > a[href^="https://www.valnetinc.com"]'))
group = '###_ca_valnet';
else if (matchDomain(['amwatch.com', 'medwatch.com', 'shippingwatch.com']))
group = '###_dk_watch_media'; // custom
else if (matchDomain(['journalauto.com', 'journaldupneu.com', 'j2rauto.com']))
group = '###_fr_synerj';
else if (matchDomain(['argusdelassurance.com']))
group = '###_fr_groupe_infopro';
else if (document.querySelector('[class*="footer" i] a[href^="https://www.delinian.com/privacy-policy"]'))
group = '###_uk_delinian'; // custom
else if (matchDomain(['oed.com']) || (hostname.startsWith('oxford') && document.querySelector('div[id^="footer"] a[href="http://www.oup.com/"]')))
group = '###_uk_oup';
else if (document.querySelector('head > meta[property][content^="https://cdn.forumcomm.com/"]'))
group = '###_usa_forum_comm';
else if (document.querySelector('li > a[href^="https://www.bnpmedia.com/"]'))
group = '###_usa_bnp_media';
else if (matchDomain(['cfo.com', 'pharmavoice.com', 'proformative.com', 'socialmediatoday.com']) || (hostname.endsWith('dive.com') && document.querySelector('script[src^="/static/js/dist/contentGate.bundle.js"], div.baseline-footer > a[href="http://www.industrydive.com"]')))
group = '###_usa_industrydive';
else if (matchDomain(['centralmaine.com', 'pressherald.com', 'sunjournal.com']))
group = '###_usa_maine_trust';
else if (document.querySelector('head > meta[name="peim_article_access_type"]'))
group = '###_usa_pei';
else if (matchDomain(['dayton.com', 'daytondailynews.com', 'journal-news.com', 'springfieldnewssun.com']))
group = 'ajc.com'; // Cox First Media
else if (matchDomain(['accountingtoday.com', 'benefitnews.com', 'bondbuyer.com', 'dig-in.com', 'financial-planning.com', 'nationalmortgagenews.com']))
group = 'americanbanker.com'; // Arizent
}
} else {
if (matchDomain(['insideretail.asia', 'insideretail.co.nz', 'insideretail.com.au', 'insideretail.us']))
group = '###_au_inside_retail';
}
if (group)
console.log(group);
ext_api.runtime.sendMessage({
request: 'custom_domain',
data: {
domain: custom_domain,
group: group
}
});
}
}, 1000);
}
function matchDomain(domains, hostname) {
var matched_domain = false;
if (!hostname)
hostname = window.location.hostname;
if (typeof domains === 'string')
domains = [domains];
domains.some(domain => (hostname === domain || hostname.endsWith('.' + domain)) && (matched_domain = domain));
return matched_domain;
}
function getCookieDomain(hostname) {
let domain = hostname;
let n = 0;
let parts = hostname.split('.');
let str = '_gd' + (new Date()).getTime();
try {
while (n < (parts.length - 1) && document.cookie.indexOf(str + '=' + str) == -1) {
domain = parts.slice(-1 - (++n)).join('.');
document.cookie = str + "=" + str + ";domain=" + domain + ";";
}
document.cookie = str + "=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=" + domain + ";";
} catch (e) {
console.log(e);
}
return domain;
}

106
contentScript_once_var.js Normal file
View file

@ -0,0 +1,106 @@
//'use strict';
var ext_api = (typeof browser === 'object') ? browser : chrome;
var hostname = window.location.hostname;
var de_madsack_domains = ['haz.de', 'kn-online.de', 'ln-online.de', 'lvz.de', 'maz-online.de', 'neuepresse.de', 'ostsee-zeitung.de', 'rnd.de', 'saechsische.de'];
if (hostname.match(/\.de$/)) {
if (matchDomain(de_madsack_domains) || document.querySelector('head > link[href*=".rndtech.de/"]')) {
function madsack_main() {
for (let n = 0; n < 25; n++) {
window.setTimeout(function () {
if (window.Fusion) {
window.Fusion.globalContent.isPaid = false;
}
}, n * 50);
}
}
insert_script(madsack_main);
}
}
if (matchDomain('dagsavisen.no')) {
function dagsavisen_main() {
for (let n = 0; n < 25; n++) {
window.setTimeout(function () {
if (window.Fusion && window.Fusion.globalContent.content_restrictions) {
window.Fusion.globalContent.content_restrictions.content_code = 0;
}
}, n * 50);
}
}
insert_script(dagsavisen_main);
}
else if (matchDomain(['journaldemontreal.com', 'journaldequebec.com'])) {
for (let n = 0; n < 50; n++) {
window.setTimeout(function () {
let article = document.querySelector('div.article-main-txt.composer-content');
if (article)
article.classList.remove('composer-content');
}, n * 50);
}
}
else if (matchDomain('nzherald.co.nz')) {
function nzherald_main() {
for (let n = 0; n < 25; n++) {
window.setTimeout(function () {
if (window.Fusion) {
window.Fusion.globalContent.isPremium = false;
}
}, n * 50);
}
}
insert_script(nzherald_main);
}
function matchDomain(domains, hostname) {
var matched_domain = false;
if (!hostname)
hostname = window.location.hostname;
if (typeof domains === 'string')
domains = [domains];
domains.some(domain => (hostname === domain || hostname.endsWith('.' + domain)) && (matched_domain = domain));
return matched_domain;
}
function removeDOMElement(...elements) {
for (let element of elements) {
if (element)
element.remove();
}
}
function waitDOMElement(selector, tagName = '', callback, multiple = false) {
new window.MutationObserver(function (mutations) {
for (let mutation of mutations) {
for (let node of mutation.addedNodes) {
if (!tagName || (node.tagName === tagName)) {
if (node.matches(selector)) {
callback(node);
if (!multiple)
this.disconnect();
}
}
}
}
}).observe(document, {
subtree: true,
childList: true
});
}
function insert_script(func, insertAfterDom) {
let bpc_script = document.querySelector('script#bpc_script');
if (!bpc_script) {
let script = document.createElement('script');
script.setAttribute('id', 'bpc_script');
script.appendChild(document.createTextNode('(' + func + ')();'));
let insertAfter = insertAfterDom ? insertAfterDom : (document.body || document.head || document.documentElement);
if (insertAfter)
insertAfter.appendChild(script);
}
}

39
custom/manifest.json Normal file
View file

@ -0,0 +1,39 @@
{
"background": {
"service_worker": "background.js"
},
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'"
},
"action": {
"default_popup": "options/popup.html"
},
"description": "Bypass Paywalls of news sites",
"homepage_url": "https://github.com/bpc-clone/bypass-paywalls-chrome-clean",
"icons": {
"128": "bypass.png"
},
"manifest_version": 3,
"minimum_chrome_version": "109",
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvLxf4oOeSoz8qKVzKGQWW5zW44hWCoOoQRGXTrObUpyoGfGzhFO8aZHQmBcLrAZMA4O6EA7GaXnHkOPCLKM11seZ4J2azb1gSswApfAlaoeOLnhDnp/Jpzz7Bt6o4HL+nhKRJUOZ9z+GXAyOkOps5O38TwJN5R6z8tLkleRgfYscp19YU/vq1x9PrbXIHJTRB7qtb/iJmiKATKisXGmFY3Nbs5m379TGqcJFBM9bI+8bSJtS4e7t0LHOwSLDq3IVRaWVsFd9P19WEDNTxuzr9+rczOrw1vgmiisNOcElse8cyVIoq4bjepvfHM/9nzDgKwQsNG5OTzujwHu2UUN4cwIDAQAB",
"name": "Bypass Paywalls Clean",
"update_url": "https://gitflic.ru/project/magnolia1234/bpc_updates/blob/raw?file=updates.xml",
"short_name": "Bypass Paywall",
"options_ui": {
"open_in_tab": true,
"page": "options/options.html"
},
"incognito": "split",
"permissions": [
"cookies",
"storage",
"activeTab",
"declarativeNetRequestWithHostAccess",
"scripting",
"offscreen"
],
"host_permissions": [
"*://*/*"
],
"version": "4.0.8.7"
}

33
custom/mv2/manifest.json Normal file
View file

@ -0,0 +1,33 @@
{
"background": {
"scripts": ["sites.js", "background.js"]
},
"content_security_policy": "script-src 'self'; object-src 'self'",
"browser_action": {
"default_popup": "options/popup.html"
},
"description": "Bypass Paywalls of news sites",
"homepage_url": "https://github.com/bpc-clone/bypass-paywalls-chrome-clean",
"icons": {
"128": "bypass.png"
},
"manifest_version": 2,
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvLxf4oOeSoz8qKVzKGQWW5zW44hWCoOoQRGXTrObUpyoGfGzhFO8aZHQmBcLrAZMA4O6EA7GaXnHkOPCLKM11seZ4J2azb1gSswApfAlaoeOLnhDnp/Jpzz7Bt6o4HL+nhKRJUOZ9z+GXAyOkOps5O38TwJN5R6z8tLkleRgfYscp19YU/vq1x9PrbXIHJTRB7qtb/iJmiKATKisXGmFY3Nbs5m379TGqcJFBM9bI+8bSJtS4e7t0LHOwSLDq3IVRaWVsFd9P19WEDNTxuzr9+rczOrw1vgmiisNOcElse8cyVIoq4bjepvfHM/9nzDgKwQsNG5OTzujwHu2UUN4cwIDAQAB",
"name": "Bypass Paywalls Clean",
"update_url": "https://gitflic.ru/project/magnolia1234/bpc_updates/blob/raw?file=updates.xml",
"short_name": "Bypass Paywall",
"options_ui": {
"open_in_tab": true,
"page": "options/options.html"
},
"incognito": "split",
"permissions": [
"cookies",
"storage",
"activeTab",
"webRequest",
"webRequestBlocking",
"*://*/*"
],
"version": "4.0.8.7"
}

1368
custom/sites_custom.json Normal file

File diff suppressed because it is too large Load diff

0
lib/empty.js Normal file
View file

4
lib/purify.min.js vendored Normal file
View file

@ -0,0 +1,4 @@
// DOMPurify dummy file (for Chrome/Chromium)
function DOMPurify() {}
DOMPurify.sanitize = (x, y = '') => x;
DOMPurify.removed = [];

940
manifest.json Normal file
View file

@ -0,0 +1,940 @@
{
"background": {
"service_worker": "background.js"
},
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'"
},
"action": {
"default_popup": "options/popup.html"
},
"description": "Bypass Paywalls of news sites",
"homepage_url": "https://gitflic.ru/project/magnolia1234/bypass-paywalls-chrome-clean",
"icons": {
"128": "bypass.png"
},
"manifest_version": 3,
"minimum_chrome_version": "109",
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvLxf4oOeSoz8qKVzKGQWW5zW44hWCoOoQRGXTrObUpyoGfGzhFO8aZHQmBcLrAZMA4O6EA7GaXnHkOPCLKM11seZ4J2azb1gSswApfAlaoeOLnhDnp/Jpzz7Bt6o4HL+nhKRJUOZ9z+GXAyOkOps5O38TwJN5R6z8tLkleRgfYscp19YU/vq1x9PrbXIHJTRB7qtb/iJmiKATKisXGmFY3Nbs5m379TGqcJFBM9bI+8bSJtS4e7t0LHOwSLDq3IVRaWVsFd9P19WEDNTxuzr9+rczOrw1vgmiisNOcElse8cyVIoq4bjepvfHM/9nzDgKwQsNG5OTzujwHu2UUN4cwIDAQAB",
"name": "Bypass Paywalls Clean",
"update_url": "https://gitflic.ru/project/magnolia1234/bpc_updates/blob/raw?file=updates.xml",
"short_name": "Bypass Paywall",
"options_ui": {
"open_in_tab": true,
"page": "options/options.html"
},
"incognito": "split",
"permissions": [
"cookies",
"storage",
"activeTab",
"declarativeNetRequestWithHostAccess",
"scripting",
"offscreen"
],
"optional_host_permissions": [
"*://*/*"
],
"host_permissions": [
"*://*.24heures.ch/*",
"*://*.360dx.com/*",
"*://*.60millions-mag.com/*",
"*://*.aachener-zeitung.de/*",
"*://*.aargauerzeitung.ch/*",
"*://*.abc.es/*",
"*://*.abcmais.com/*",
"*://*.abendblatt.de/*",
"*://*.abqjournal.com/*",
"*://*.abril.com.br/*",
"*://*.actu.fr/*",
"*://*.ad.nl/*",
"*://*.adage.com/*",
"*://*.adelaidenow.com.au/*",
"*://*.adweek.com/*",
"*://*.aerokurier.de/*",
"*://*.aerztezeitung.de/*",
"*://*.afr.com/*",
"*://*.ajc.com/*",
"*://*.al.com/*",
"*://*.allgemeine-zeitung.de/*",
"*://*.alternatives-economiques.fr/*",
"*://*.ambito.com/*",
"*://*.americanaffairsjournal.org/*",
"*://*.americanbanker.com/*",
"*://*.americanpurpose.com/*",
"*://*.americastestkitchen.com/*",
"*://*.apollo-magazine.com/*",
"*://*.ara.cat/*",
"*://*.arabalears.cat/*",
"*://*.architecturaldigest.com/*",
"*://*.arcinfo.ch/*",
"*://*.artforum.com/*",
"*://*.artnet.com/*",
"*://*.artsenkrant.com/*",
"*://*.atavist.com/*",
"*://*.atlantico.fr/*",
"*://*.auto-motor-und-sport.de/*",
"*://*.auto-swiat.pl/*",
"*://*.autocar.co.uk/*",
"*://*.autohebdo.fr/*",
"*://*.automobilwoche.de/*",
"*://*.autonews.com/*",
"*://*.autoplus.fr/*",
"*://*.autosport.com/*",
"*://*.axios.com/*",
"*://*.azcentral.com/*",
"*://*.backpacker.com/*",
"*://*.balkaninsight.com/*",
"*://*.baltimoresun.com/*",
"*://*.barandbench.com/*",
"*://*.bazonline.ch/*",
"*://*.bd.nl/*",
"*://*.beleggersbelangen.nl/*",
"*://*.belfasttelegraph.co.uk/*",
"*://*.bendigoadvertiser.com.au/*",
"*://*.benzinga.com/*",
"*://*.beobachter.ch/*",
"*://*.berliner-zeitung.de/*",
"*://*.berlingske.dk/*",
"*://*.bernerzeitung.ch/*",
"*://*.betamtb.com/*",
"*://*.betternutrition.com/*",
"*://*.betterprogramming.pub/*",
"*://*.bhaskar.com/*",
"*://*.bicycling.com/*",
"*://*.bild.de/*",
"*://*.billboard.com/*",
"*://*.bizjournals.com/*",
"*://*.blick.ch/*",
"*://*.bloomberg.com/*",
"*://*.bloombergadria.com/*",
"*://*.bnd.com/*",
"*://*.bndestem.nl/*",
"*://*.boersen-zeitung.de/*",
"*://*.bonappetit.com/*",
"*://*.bordermail.com.au/*",
"*://*.bostonglobe.com/*",
"*://*.bostonherald.com/*",
"*://*.braunschweiger-zeitung.de/*",
"*://*.brill.com/*",
"*://*.brisbanetimes.com.au/*",
"*://*.britannica.com/*",
"*://*.bt.no/*",
"*://*.buffalonews.com/*",
"*://*.business-standard.com/*",
"*://*.businessam.be/*",
"*://*.businessdailyafrica.com/*",
"*://*.businessdesk.co.nz/*",
"*://*.businessinsider.com.pl/*",
"*://*.businessinsider.com/*",
"*://*.businessinsider.jp/*",
"*://*.businessinsider.nl/*",
"*://*.businessoffashion.com/*",
"*://*.businesspost.ie/*",
"*://*.businesstimes.com.sg/*",
"*://*.cairnspost.com.au/*",
"*://*.calgaryherald.com/*",
"*://*.cambiocolombia.com/*",
"*://*.canarias7.es/*",
"*://*.canberratimes.com.au/*",
"*://*.capital.bg/*",
"*://*.capital.fr/*",
"*://*.capitalgazette.com/*",
"*://*.cartacapital.com.br/*",
"*://*.causeur.fr/*",
"*://*.cen.acs.org/*",
"*://*.centralwesterndaily.com.au/*",
"*://*.centrepresseaveyron.fr/*",
"*://*.challenges.fr/*",
"*://*.charentelibre.fr/*",
"*://*.charliehebdo.fr/*",
"*://*.charlotteobserver.com/*",
"*://*.chicagobusiness.com/*",
"*://*.chicagotribune.com/*",
"*://*.chronicle.com/*",
"*://*.cicero.de/*",
"*://*.cincinnati.com/*",
"*://*.citywire.com/*",
"*://*.clarin.com/*",
"*://*.cleaneatingmag.com/*",
"*://*.cleveland.com/*",
"*://*.clicrbs.com.br/*",
"*://*.climbing.com/*",
"*://*.cnbc.com/*",
"*://*.cnn.com/*",
"*://*.cntraveler.com/*",
"*://*.codesports.com.au/*",
"*://*.columbian.com/*",
"*://*.commentary.org/*",
"*://*.commercialappeal.com/*",
"*://*.computerweekly.com/*",
"*://*.connaissancedesarts.com/*",
"*://*.correiodopovo.com.br/*",
"*://*.corriere.it/*",
"*://*.corriereadriatico.it/*",
"*://*.corrieredellosport.it/*",
"*://*.cosmopolitan.com/*",
"*://*.cosmopolitan.fr/*",
"*://*.countryliving.com/*",
"*://*.courant.com/*",
"*://*.courier-journal.com/*",
"*://*.couriermail.com.au/*",
"*://*.courrierinternational.com/*",
"*://*.crainscleveland.com/*",
"*://*.crainsdetroit.com/*",
"*://*.crainsgrandrapids.com/*",
"*://*.crainsnewyork.com/*",
"*://*.crikey.com.au/*",
"*://*.cronista.com/*",
"*://*.crusoe.com.br/*",
"*://*.csmonitor.com/*",
"*://*.ctpost.com/*",
"*://*.curbed.com/*",
"*://*.cw.com.tw/*",
"*://*.cyclingnews.com/*",
"*://*.dagensmedicin.se/*",
"*://*.dagsavisen.no/*",
"*://*.dailyadvertiser.com.au/*",
"*://*.dailyliberal.com.au/*",
"*://*.dailymail.co.uk/*",
"*://*.dailypress.com/*",
"*://*.dailytelegraph.com.au/*",
"*://*.dailywire.com/*",
"*://*.dallasnews.com/*",
"*://*.decanter.com/*",
"*://*.defector.com/*",
"*://*.delish.com/*",
"*://*.democratandchronicle.com/*",
"*://*.demorgen.be/*",
"*://*.denik.cz/*",
"*://*.denverpost.com/*",
"*://*.derbund.ch/*",
"*://*.desmoinesregister.com/*",
"*://*.destentor.nl/*",
"*://*.detroitnews.com/*",
"*://*.df.cl/*",
"*://*.dhnet.be/*",
"*://*.diariocorreo.pe/*",
"*://*.diariodemallorca.es/*",
"*://*.diariodenavarra.es/*",
"*://*.diariosur.es/*",
"*://*.diariovasco.com/*",
"*://*.digiday.com/*",
"*://*.digitimes.com/*",
"*://*.diplomatique.org.br/*",
"*://*.discovermagazine.com/*",
"*://*.dispatch.com/*",
"*://*.dn.no/*",
"*://*.dn.pt/*",
"*://*.dn.se/*",
"*://*.dnevnik.bg/*",
"*://*.doorbraak.be/*",
"*://*.dvhn.nl/*",
"*://*.dwell.com/*",
"*://*.eastbaytimes.com/*",
"*://*.eastwest.eu/*",
"*://*.echo-online.de/*",
"*://*.economictimes.com/*",
"*://*.economist.com/*",
"*://*.ed.nl/*",
"*://*.editorialedomani.it/*",
"*://*.elcomercio.es/*",
"*://*.elcomercio.pe/*",
"*://*.elconfidencial.com/*",
"*://*.elcorreo.com/*",
"*://*.eldeber.com.bo/*",
"*://*.eldia.es/*",
"*://*.eldiario.es/*",
"*://*.eldiariomontanes.es/*",
"*://*.elespanol.com/*",
"*://*.elespectador.com/*",
"*://*.elle.com/*",
"*://*.elle.fr/*",
"*://*.elledecor.com/*",
"*://*.elmercurio.com/*",
"*://*.elmundo.es/*",
"*://*.elnortedecastilla.es/*",
"*://*.elnuevoherald.com/*",
"*://*.elobservador.com.uy/*",
"*://*.elpais.com.uy/*",
"*://*.elpais.com/*",
"*://*.elperiodico.com/*",
"*://*.eltiempo.com/*",
"*://*.eltribuno.com/*",
"*://*.eluniversal.com.mx/*",
"*://*.eluniverso.com/*",
"*://*.em.com.br/*",
"*://*.enotes.com/*",
"*://*.epe.es/*",
"*://*.epicurious.com/*",
"*://*.epoch.org.il/*",
"*://*.espn.com/*",
"*://*.esprit.presse.fr/*",
"*://*.esquire.com/*",
"*://*.estadao.com.br/*",
"*://*.etc.se/*",
"*://*.euobserver.com/*",
"*://*.european-rubber-journal.com/*",
"*://*.europower.no/*",
"*://*.exame.com/*",
"*://*.examiner.com.au/*",
"*://*.expansion.com/*",
"*://*.expressnews.com/*",
"*://*.expresso.pt/*",
"*://*.farodevigo.es/*",
"*://*.fastcompany.com/*",
"*://*.faz.net/*",
"*://*.femmesdaujourdhui.be/*",
"*://*.fieldandstream.com/*",
"*://*.financialexpress.com/*",
"*://*.financialpost.com/*",
"*://*.firstthings.com/*",
"*://*.fiskeribladet.no/*",
"*://*.flair.be/*",
"*://*.flair.nl/*",
"*://*.flugrevue.de/*",
"*://*.fnlondon.com/*",
"*://*.forbes.com.au/*",
"*://*.forbes.com/*",
"*://*.forbes.pl/*",
"*://*.forbes.ua/*",
"*://*.foreignaffairs.com/*",
"*://*.foreignpolicy.com/*",
"*://*.fortune.com/*",
"*://*.foxnews.com/*",
"*://*.fr.de/*",
"*://*.freep.com/*",
"*://*.freitag.de/*",
"*://*.fresnobee.com/*",
"*://*.ft.com/*",
"*://*.ftm.eu/*",
"*://*.ftm.nl/*",
"*://*.ga.de/*",
"*://*.gazetadopovo.com.br/*",
"*://*.gazzetta.it/*",
"*://*.gbnews.com/*",
"*://*.geelongadvertiser.com.au/*",
"*://*.gelderlander.nl/*",
"*://*.genomeweb.com/*",
"*://*.gestion.pe/*",
"*://*.glassdoor.com/*",
"*://*.globes.co.il/*",
"*://*.globo.com/*",
"*://*.glossy.co/*",
"*://*.goldcoastbulletin.com.au/*",
"*://*.goodhousekeeping.com/*",
"*://*.gq.com/*",
"*://*.granta.com/*",
"*://*.groene.nl/*",
"*://*.grubstreet.com/*",
"*://*.gva.be/*",
"*://*.haaretz.co.il/*",
"*://*.haaretz.com/*",
"*://*.handelsblatt.com/*",
"*://*.handelszeitung.ch/*",
"*://*.harpers.org/*",
"*://*.harpersbazaar.com/*",
"*://*.harzkurier.de/*",
"*://*.haz.de/*",
"*://*.hbr.org/*",
"*://*.hbvl.be/*",
"*://*.hd.se/*",
"*://*.heise.de/*",
"*://*.heraldsun.com.au/*",
"*://*.hilltimes.com/*",
"*://*.hindustantimes.com/*",
"*://*.historyextra.com/*",
"*://*.historytoday.com/*",
"*://*.hln.be/*",
"*://*.housebeautiful.com/*",
"*://*.houstonchronicle.com/*",
"*://*.hoy.es/*",
"*://*.huffingtonpost.it/*",
"*://*.humo.be/*",
"*://*.hydrogeninsight.com/*",
"*://*.ideal.es/*",
"*://*.ikz-online.de/*",
"*://*.ilfattoquotidiano.it/*",
"*://*.ilfoglio.it/*",
"*://*.ilgazzettino.it/*",
"*://*.ilgiorno.it/*",
"*://*.illawarramercury.com.au/*",
"*://*.ilmanifesto.it/*",
"*://*.ilmattino.it/*",
"*://*.ilmessaggero.it/*",
"*://*.ilrestodelcarlino.it/*",
"*://*.ilsole24ore.com/*",
"*://*.iltelegrafolivorno.it/*",
"*://*.iltirreno.it/*",
"*://*.inc.com/*",
"*://*.inc42.com/*",
"*://*.independent.co.uk/*",
"*://*.independent.ie/*",
"*://*.indianexpress.com/*",
"*://*.indiatimes.com/*",
"*://*.indiatoday.in/*",
"*://*.indystar.com/*",
"*://*.inews.co.uk/*",
"*://*.informacion.es/*",
"*://*.infzm.com/*",
"*://*.inkl.com/*",
"*://*.inquirer.com/*",
"*://*.insidehighered.com/*",
"*://*.intelligentinvestor.com.au/*",
"*://*.interestingengineering.com/*",
"*://*.internazionale.it/*",
"*://*.intrafish.com/*",
"*://*.intrafish.no/*",
"*://*.investorschronicle.co.uk/*",
"*://*.investsmart.com.au/*",
"*://*.ipolitics.ca/*",
"*://*.irishexaminer.com/*",
"*://*.irishnews.com/*",
"*://*.irishtimes.com/*",
"*://*.italian.tech/*",
"*://*.italiaoggi.it/*",
"*://*.jacksonville.com/*",
"*://*.jacobin.de/*",
"*://*.japantimes.co.jp/*",
"*://*.jazzwise.com/*",
"*://*.jeuneafrique.com/*",
"*://*.jgnt.co/*",
"*://*.journaldemillau.fr/*",
"*://*.journaldemontreal.com/*",
"*://*.journaldequebec.com/*",
"*://*.journaldunet.com/*",
"*://*.journalnow.com/*",
"*://*.journalstar.com/*",
"*://*.jpost.com/*",
"*://*.jsonline.com/*",
"*://*.kansas.com/*",
"*://*.kansascity.com/*",
"*://*.kathimerini.gr/*",
"*://*.kentucky.com/*",
"*://*.kn-online.de/*",
"*://*.knack.be/*",
"*://*.knoxnews.com/*",
"*://*.kompas.id/*",
"*://*.komputerswiat.pl/*",
"*://*.krautreporter.de/*",
"*://*.ksta.de/*",
"*://*.kurier.at/*",
"*://*.kw.be/*",
"*://*.la-croix.com/*",
"*://*.labusinessjournal.com/*",
"*://*.lacote.ch/*",
"*://*.ladepeche.fr/*",
"*://*.ladiaria.com.uy/*",
"*://*.lagaceta.com.ar/*",
"*://*.lalibre.be/*",
"*://*.lamontagne.fr/*",
"*://*.lanacion.com.ar/*",
"*://*.lanazione.it/*",
"*://*.lanouvellerepublique.fr/*",
"*://*.lanuovasardegna.it/*",
"*://*.laprovincia.es/*",
"*://*.larepubliquedespyrenees.fr/*",
"*://*.larioja.com/*",
"*://*.lasprovincias.es/*",
"*://*.lastampa.it/*",
"*://*.latercera.com/*",
"*://*.latimes.com/*",
"*://*.lavanguardia.com/*",
"*://*.lavenir.net/*",
"*://*.laverdad.es/*",
"*://*.lavoz.com.ar/*",
"*://*.lavozdigital.es/*",
"*://*.lc.nl/*",
"*://*.le1hebdo.fr/*",
"*://*.lecho.be/*",
"*://*.lecourrierdesstrateges.fr/*",
"*://*.ledevoir.com/*",
"*://*.lefigaro.fr/*",
"*://*.legrandcontinent.eu/*",
"*://*.lehighvalleylive.com/*",
"*://*.lejdd.fr/*",
"*://*.lemagit.fr/*",
"*://*.lemonde.fr/*",
"*://*.lenouveleconomiste.fr/*",
"*://*.lenouvelliste.ch/*",
"*://*.leparisien.fr/*",
"*://*.lepoint.fr/*",
"*://*.lequipe.fr/*",
"*://*.lequotidiendumedecin.fr/*",
"*://*.lequotidiendupharmacien.fr/*",
"*://*.lerevenu.com/*",
"*://*.lescienze.it/*",
"*://*.lesechos.fr/*",
"*://*.lesinrocks.com/*",
"*://*.lesoleil.com/*",
"*://*.letelegramme.fr/*",
"*://*.levante-emv.com/*",
"*://*.levif.be/*",
"*://*.lexpress.fr/*",
"*://*.libelle.be/*",
"*://*.libelle.nl/*",
"*://*.liberation.fr/*",
"*://*.linda.nl/*",
"*://*.lindependant.fr/*",
"*://*.linforme.com/*",
"*://*.literaryreview.co.uk/*",
"*://*.livelaw.in/*",
"*://*.livemint.com/*",
"*://*.ln-online.de/*",
"*://*.lne.es/*",
"*://*.loebclassics.com/*",
"*://*.loeildelaphotographie.com/*",
"*://*.lopinion.fr/*",
"*://*.losandes.com.ar/*",
"*://*.lrb.co.uk/*",
"*://*.luzernerzeitung.ch/*",
"*://*.lvz.de/*",
"*://*.macrobusiness.com.au/*",
"*://*.madison.com/*",
"*://*.magazyn-kuchnia.pl/*",
"*://*.mailonsunday.co.uk/*",
"*://*.mainichi.jp/*",
"*://*.mallorcazeitung.es/*",
"*://*.manager-magazin.de/*",
"*://*.mannheimer-morgen.de/*",
"*://*.manoramaonline.com/*",
"*://*.marca.com/*",
"*://*.margriet.nl/*",
"*://*.marianne.net/*",
"*://*.marketwatch.com/*",
"*://*.masslive.com/*",
"*://*.maz-online.de/*",
"*://*.mcall.com/*",
"*://*.mcclatchy.com/*",
"*://*.mcclatchydc.com/*",
"*://*.medium.com/*",
"*://*.medscape.com/*",
"*://*.menshealth.com/*",
"*://*.mercurynews.com/*",
"*://*.merkur.de/*",
"*://*.mexiconewsdaily.com/*",
"*://*.miamiherald.com/*",
"*://*.mid-day.com/*",
"*://*.midilibre.fr/*",
"*://*.milanofinanza.it/*",
"*://*.mlive.com/*",
"*://*.moda.it/*",
"*://*.modernhealthcare.com/*",
"*://*.modernretail.co/*",
"*://*.monacomatin.mc/*",
"*://*.monocle.com/*",
"*://*.mopo.de/*",
"*://*.morgenpost.de/*",
"*://*.motorradonline.de/*",
"*://*.motorsportmagazine.com/*",
"*://*.mundodeportivo.com/*",
"*://*.mv-voice.com/*",
"*://*.nation.africa/*",
"*://*.nationalgeographic.com/*",
"*://*.nationalpost.com/*",
"*://*.nationalreview.com/*",
"*://*.nautil.us/*",
"*://*.ndtvprofit.com/*",
"*://*.neuepresse.de/*",
"*://*.newcastleherald.com.au/*",
"*://*.newcriterion.com/*",
"*://*.newrepublic.com/*",
"*://*.news-press.com/*",
"*://*.newscientist.com/*",
"*://*.newsday.com/*",
"*://*.newslaundry.com/*",
"*://*.newsobserver.com/*",
"*://*.newstatesman.com/*",
"*://*.newsweek.com/*",
"*://*.newsweek.pl/*",
"*://*.newyorker.com/*",
"*://*.nhregister.com/*",
"*://*.niagarafallsreview.ca/*",
"*://*.nicematin.com/*",
"*://*.nieuwsblad.be/*",
"*://*.nikkei.com/*",
"*://*.nj.com/*",
"*://*.nola.com/*",
"*://*.northerndailyleader.com.au/*",
"*://*.northjersey.com/*",
"*://*.noz.de/*",
"*://*.nrc.nl/*",
"*://*.nrpyrenees.fr/*",
"*://*.nrz.de/*",
"*://*.nsctotal.com.br/*",
"*://*.nv.ua/*",
"*://*.nw.de/*",
"*://*.nwitimes.com/*",
"*://*.nwzonline.de/*",
"*://*.nybooks.com/*",
"*://*.nydailynews.com/*",
"*://*.nymag.com/*",
"*://*.nysun.com/*",
"*://*.nyteknik.se/*",
"*://*.nytimes.com/*",
"*://*.nzherald.co.nz/*",
"*://*.nzz.ch/*",
"*://*.observador.pt/*",
"*://*.ocbj.com/*",
"*://*.ocregister.com/*",
"*://*.oklahoman.com/*",
"*://*.ole.com.ar/*",
"*://*.omaha.com/*",
"*://*.onet.pl/*",
"*://*.oprahdaily.com/*",
"*://*.oregonlive.com/*",
"*://*.orlandosentinel.com/*",
"*://*.ostsee-zeitung.de/*",
"*://*.otz.de/*",
"*://*.outdoorlife.com/*",
"*://*.outlookbusiness.com/*",
"*://*.outlookindia.com/*",
"*://*.outsideonline.com/*",
"*://*.ovb-online.de/*",
"*://*.oxygenmag.com/*",
"*://*.paloaltoonline.com/*",
"*://*.parismatch.com/*",
"*://*.parkiet.com/*",
"*://*.parool.nl/*",
"*://*.pastemagazine.com/*",
"*://*.pb.pl/*",
"*://*.pennlive.com/*",
"*://*.petitbleu.fr/*",
"*://*.philanthropy.com/*",
"*://*.philomag.com/*",
"*://*.philomag.de/*",
"*://*.philonomist.com/*",
"*://*.philosophynow.org/*",
"*://*.pilotonline.com/*",
"*://*.pionline.com/*",
"*://*.piqd.de/*",
"*://*.piratewires.com/*",
"*://*.plasticsnews.com/*",
"*://*.politicaexterior.com/*",
"*://*.politico.com/*",
"*://*.politis.fr/*",
"*://*.polityka.pl/*",
"*://*.popsci.com/*",
"*://*.popularmechanics.com/*",
"*://*.post-gazette.com/*",
"*://*.pourlascience.fr/*",
"*://*.pourleco.com/*",
"*://*.precisionmedicineonline.com/*",
"*://*.pressenterprise.com/*",
"*://*.prevention.com/*",
"*://*.profi.de/*",
"*://*.profil.at/*",
"*://*.project-syndicate.org/*",
"*://*.prospectmagazine.co.uk/*",
"*://*.public.fr/*",
"*://*.publico.es/*",
"*://*.puck.news/*",
"*://*.pzc.nl/*",
"*://*.quora.com/*",
"*://*.quotidiano.net/*",
"*://*.quotidianodipuglia.it/*",
"*://*.qz.com/*",
"*://*.rechargenews.com/*",
"*://*.record.pt/*",
"*://*.reforme.net/*",
"*://*.repubblica.it/*",
"*://*.reuters.com/*",
"*://*.reviewjournal.com/*",
"*://*.revistaoeste.com/*",
"*://*.revue21.fr/*",
"*://*.revueconflits.com/*",
"*://*.rheinpfalz.de/*",
"*://*.richmond.com/*",
"*://*.rivals.com/*",
"*://*.rnd.de/*",
"*://*.roadandtrack.com/*",
"*://*.rollingstone.com/*",
"*://*.rp-online.de/*",
"*://*.rp.pl/*",
"*://*.rubbernews.com/*",
"*://*.rugbypass.com/*",
"*://*.rugbyrama.fr/*",
"*://*.ruhrnachrichten.de/*",
"*://*.rundschau-online.de/*",
"*://*.runnersworld.com/*",
"*://*.saarbruecker-zeitung.de/*",
"*://*.sabado.pt/*",
"*://*.sacbee.com/*",
"*://*.saechsische.de/*",
"*://*.sandiegouniontribune.com/*",
"*://*.scholastic.com/*",
"*://*.schweizermonat.ch/*",
"*://*.science-et-vie.com/*",
"*://*.science.org/*",
"*://*.sciencenews.org/*",
"*://*.sciencesetavenir.fr/*",
"*://*.scienceshumaines.com/*",
"*://*.scientificamerican.com/*",
"*://*.scmp.com/*",
"*://*.scotsman.com/*",
"*://*.sdbj.com/*",
"*://*.seattletimes.com/*",
"*://*.sfchronicle.com/*",
"*://*.sfstandard.com/*",
"*://*.sfvbj.com/*",
"*://*.shreveportbossieradvocate.com/*",
"*://*.shz.de/*",
"*://*.si.com/*",
"*://*.silive.com/*",
"*://*.skimag.com/*",
"*://*.sky.it/*",
"*://*.slate.com/*",
"*://*.slideshare.net/*",
"*://*.sloanreview.mit.edu/*",
"*://*.sltrib.com/*",
"*://*.smartcompany.com.au/*",
"*://*.smh.com.au/*",
"*://*.sofrep.com/*",
"*://*.sourcingjournal.com/*",
"*://*.spectator.co.uk/*",
"*://*.spectator.com.au/*",
"*://*.spektrum.de/*",
"*://*.spglobal.com/*",
"*://*.spiegel.de/*",
"*://*.sportico.com/*",
"*://*.springermedizin.de/*",
"*://*.standaard.be/*",
"*://*.standard.co.uk/*",
"*://*.standard.net.au/*",
"*://*.standardmedia.co.ke/*",
"*://*.star-telegram.com/*",
"*://*.staradvertiser.com/*",
"*://*.startribune.com/*",
"*://*.statesman.com/*",
"*://*.statnews.com/*",
"*://*.stcatharinesstandard.ca/*",
"*://*.stereogum.com/*",
"*://*.stltoday.com/*",
"*://*.stocknews.com/*",
"*://*.straitstimes.com/*",
"*://*.stratfor.com/*",
"*://*.study.com/*",
"*://*.stylist.co.uk/*",
"*://*.sudouest.fr/*",
"*://*.sueddeutsche.de/*",
"*://*.suedkurier.de/*",
"*://*.sun-sentinel.com/*",
"*://*.suomensotilas.fi/*",
"*://*.sustainableplastics.com/*",
"*://*.swarajyamag.com/*",
"*://*.sydsvenskan.se/*",
"*://*.syracuse.com/*",
"*://*.t3n.de/*",
"*://*.tagblatt.ch/*",
"*://*.tagesanzeiger.ch/*",
"*://*.tagesspiegel.de/*",
"*://*.tampabay.com/*",
"*://*.tdg.ch/*",
"*://*.techinasia.com/*",
"*://*.technologyreview.com/*",
"*://*.techtarget.com/*",
"*://*.telegraaf.nl/*",
"*://*.telegraph.co.uk/*",
"*://*.telerama.fr/*",
"*://*.tempo.co/*",
"*://*.tennessean.com/*",
"*://*.tes.com/*",
"*://*.texasmonthly.com/*",
"*://*.the-american-interest.com/*",
"*://*.the-independent.com/*",
"*://*.the-scientist.com/*",
"*://*.the-tls.co.uk/*",
"*://*.theadvocate.com.au/*",
"*://*.theadvocate.com/*",
"*://*.theage.com.au/*",
"*://*.theamericanconservative.com/*",
"*://*.theamericanscholar.org/*",
"*://*.theartnewspaper.com/*",
"*://*.theatlantic.com/*",
"*://*.theaustralian.com.au/*",
"*://*.thebaffler.com/*",
"*://*.thebaltimorebanner.com/*",
"*://*.thebookseller.com/*",
"*://*.thebulletin.org/*",
"*://*.thechronicle.com.au/*",
"*://*.thecourier.com.au/*",
"*://*.thecritic.co.uk/*",
"*://*.thecut.com/*",
"*://*.thedailybeast.com/*",
"*://*.thediplomat.com/*",
"*://*.thedispatch.com/*",
"*://*.theepochtimes.com/*",
"*://*.theglobeandmail.com/*",
"*://*.thehill.com/*",
"*://*.thehindu.com/*",
"*://*.thehindubusinessline.com/*",
"*://*.theimpression.com/*",
"*://*.theinitium.com/*",
"*://*.theintercept.com/*",
"*://*.thejuggernaut.com/*",
"*://*.thelampmagazine.com/*",
"*://*.thelawyer.com/*",
"*://*.theleaflet.in/*",
"*://*.themandarin.com.au/*",
"*://*.themarker.com/*",
"*://*.themarket.ch/*",
"*://*.themercury.com.au/*",
"*://*.thenation.com/*",
"*://*.thenewatlantis.com/*",
"*://*.theneweuropean.co.uk/*",
"*://*.thenewslens.com/*",
"*://*.thenewsminute.com/*",
"*://*.thepeterboroughexaminer.com/*",
"*://*.thepointmag.com/*",
"*://*.theprovince.com/*",
"*://*.thequint.com/*",
"*://*.therecord.com/*",
"*://*.thesaturdaypaper.com.au/*",
"*://*.thescottishsun.co.uk/*",
"*://*.thespec.com/*",
"*://*.thespectator.com/*",
"*://*.thestage.co.uk/*",
"*://*.thestar.com/*",
"*://*.thestate.com/*",
"*://*.thesun.co.uk/*",
"*://*.thetimes.com/*",
"*://*.theverge.com/*",
"*://*.theweek.com/*",
"*://*.thewest.com.au/*",
"*://*.thewrap.com/*",
"*://*.thisismoney.co.uk/*",
"*://*.thueringer-allgemeine.de/*",
"*://*.tijd.be/*",
"*://*.timeshighereducation.com/*",
"*://*.timesunion.com/*",
"*://*.tirebusiness.com/*",
"*://*.tlz.de/*",
"*://*.topagrar.com/*",
"*://*.torontosun.com/*",
"*://*.towardsdatascience.com/*",
"*://*.townandcountrymag.com/*",
"*://*.townsvillebulletin.com.au/*",
"*://*.tradewindsnews.com/*",
"*://*.trailrunnermag.com/*",
"*://*.tri-cityherald.com/*",
"*://*.triathlete.com/*",
"*://*.trouw.nl/*",
"*://*.tt.com/*",
"*://*.tubantia.nl/*",
"*://*.tucson.com/*",
"*://*.tulsaworld.com/*",
"*://*.tuttosport.com/*",
"*://*.twincities.com/*",
"*://*.unherd.com/*",
"*://*.uol.com.br/*",
"*://*.upstreamonline.com/*",
"*://*.usatoday.com/*",
"*://*.usinenouvelle.com/*",
"*://*.utech-polyurethane.com/*",
"*://*.valeursactuelles.com/*",
"*://*.vancouversun.com/*",
"*://*.vanityfair.com/*",
"*://*.variety.com/*",
"*://*.varmatin.com/*",
"*://*.vegetariantimes.com/*",
"*://*.vice.com/*",
"*://*.vikatan.com/*",
"*://*.vn.at/*",
"*://*.vn.nl/*",
"*://*.vogue.co.uk/*",
"*://*.vogue.com/*",
"*://*.voguebusiness.com/*",
"*://*.vol.at/*",
"*://*.volksfreund.de/*",
"*://*.volkskrant.nl/*",
"*://*.vox.com/*",
"*://*.vulture.com/*",
"*://*.washingtonexaminer.com/*",
"*://*.washingtonpost.com/*",
"*://*.watoday.com.au/*",
"*://*.waz.de/*",
"*://*.weeklytimesnow.com.au/*",
"*://*.wellandtribune.ca/*",
"*://*.welt.de/*",
"*://*.weltkunst.de/*",
"*://*.weser-kurier.de/*",
"*://*.westernadvocate.com.au/*",
"*://*.wiesbadener-kurier.de/*",
"*://*.winnipegfreepress.com/*",
"*://*.wired.com/*",
"*://*.wochenblatt.com/*",
"*://*.womenshealth.de/*",
"*://*.womenshealthmag.com/*",
"*://*.womensrunning.com/*",
"*://*.wonderzine.com/*",
"*://*.wp.de/*",
"*://*.wr.de/*",
"*://*.wsj.com/*",
"*://*.wwd.com/*",
"*://*.wyborcza.biz/*",
"*://*.wyborcza.pl/*",
"*://*.wysokieobcasy.pl/*",
"*://*.ynet.co.il/*",
"*://*.yogajournal.com/*",
"*://*.yorkshirepost.co.uk/*",
"*://*.zeit.de/*",
"*://*.zerohedge.com/*",
"*://*.amplitude.com/*",
"*://*.ampproject.org/*",
"*://*.axate.io/*",
"*://*.blueconic.net/*",
"*://*.cxense.com/*",
"*://*.ensighten.com/*",
"*://*.evolok.net/*",
"*://*.fewcents.co/*",
"*://*.loader-cdn.azureedge.net/*",
"*://*.matheranalytics.com/*",
"*://*.newsmemory.com/*",
"*://*.omeda.com/*",
"*://*.onecount.net/*",
"*://*.pelcro.com/*",
"*://*.piano.io/*",
"*://*.pico.tools/*",
"*://*.poool.fr/*",
"*://*.qiota.com/*",
"*://*.sophi.io/*",
"*://*.steadyhq.com/*",
"*://*.tinypass.com/*",
"*://*.zephr.com/*",
"*://*.blink.net/*",
"*://*.bwbx.io/*",
"*://*.cedscdn.it/*",
"*://*.cedsdigital.it/*",
"*://*.corriereobjects.it/*",
"*://*.djservices.io/*",
"*://*.dowjones.io/*",
"*://*.emol.cl/*",
"*://*.epochbase.com/*",
"*://*.epochbase.eu/*",
"*://*.flip-pay.com/*",
"*://*.funkemedien.de/*",
"*://*.gjirafa.tech/*",
"*://*.go.com/*",
"*://*.hadrianpaywall.com/*",
"*://*.kinja-static.com/*",
"*://*.medscapestatic.com/*",
"*://*.ndcmediagroep.nl/*",
"*://*.nhst.tech/*",
"*://*.nyt.com/*",
"*://*.pasedigital.cl/*",
"*://*.townnews.com/*",
"*://*.wallkit.net/*",
"*://*.wbmdstatic.com/*",
"*://*.wgchrrammzv.com/*",
"*://*.zeddit.com/*",
"*://archive.fo/*",
"*://archive.is/*",
"*://archive.li/*",
"*://archive.md/*",
"*://archive.ph/*",
"*://archive.vn/*",
"*://codebeautify.org/*",
"*://gitflic.ru/*"
],
"version": "4.0.8.7"
}

48
options/clearCookies.js Normal file
View file

@ -0,0 +1,48 @@
var ext_api = (typeof browser === 'object') ? browser : chrome;
try {
window.localStorage.clear();
sessionStorage.clear();
} catch (e) {
console.log(e);
}
var cookie_domain = getCookieDomain(document.domain);
// send domain to background.js (to clear cookies)
ext_api.runtime.sendMessage({
request: 'clear_cookies_domain',
data: {
domain: cookie_domain
}
});
function getCookieDomain(hostname) {
let domain = hostname;
let n = 0;
let parts = hostname.split('.');
let str = '_gd' + (new Date()).getTime();
try {
while (n < (parts.length - 1) && document.cookie.indexOf(str + '=' + str) == -1) {
domain = parts.slice(-1 - (++n)).join('.');
document.cookie = str + "=" + str + ";domain=" + domain + ";";
}
document.cookie = str + "=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=" + domain + ";";
} catch (e) {
console.log(e);
}
return domain;
}
var msg = "Cookies (and local storage) removed from " + cookie_domain;
showMessage(msg, 2000);
function showMessage(msg, duration) {
var el = document.createElement("div");
el.setAttribute("style", "position:fixed;top:40%;left:40%;z-index:99;padding:4px;font-family: Arial, sans-serif;font-size:18px;color:white;background-color:blue;");
el.innerText = msg;
setTimeout(function () {
el.parentNode.removeChild(el);
}, duration);
(document.body || document.head || document.documentElement).appendChild(el);
}

155
options/htmlviewer.js Normal file
View file

@ -0,0 +1,155 @@
if (window.location.href === 'https://codebeautify.org/htmlviewer') {
let htmlviewer = document.querySelector('head > link[rel="canonical"][href="https://codebeautify.org/htmlviewer"]');
if (!htmlviewer) {
let ads = 'div.OUTBRAIN, div[id^="taboola-"], div.ad-container, div[class*="-ad-container"], div[class*="_ad-container"], div.arc_ad, div[id^="adv-"], div[class^="ad-"], div[class^="ad_"], div[class^="advert"], aside.ad';
hideDOMStyle(ads, 10);
let cookie_consent = 'div#didomi-host, div#onetrust-consent-sdk, div[id^="sp_message_container"], div#CybotCookiebotDialog, div#usercentrics-root, div.cmp-root-container';
hideDOMStyle(cookie_consent, 11);
let cybot_fade = document.querySelector('div#CybotCookiebotDialogBodyUnderlay');
if (cybot_fade)
cybot_fade.remove();
let html_noscroll = ['cmp-modal-open', 'sp-message-open'];
for (let elem of html_noscroll) {
let noscroll = document.querySelector('html[class~="' + elem + '"]');
if (noscroll)
noscroll.classList.remove(elem);
}
let body_noscroll = ['no-scroll', 'overflowHidden', 'showFirstLayer'];
for (let elem of body_noscroll) {
let noscroll = document.querySelector('body[class~="' + elem + '"]');
if (noscroll)
noscroll.classList.remove(elem);
}
let overflow_hidden = document.querySelector('body[style*="overflow: hidden;"]');
if (overflow_hidden)
overflow_hidden.style.overflow = 'auto';
unhideDataImages()
let hide;
let canonical = document.querySelector('head > link[rel="canonical"][href], link[rel="canonical"][href]');
if (canonical) {
let canonical_url = canonical.href;
let hostname = urlHost(canonical_url);
correctLinks(hostname);
unhideHostImages(hostname);
if (hostname.endsWith('.de')) {
if (matchUrlDomain('augsburger-allgemeine.de', canonical_url)) {
hide = 'div.pt_onlinestory';
} else if (matchUrlDomain('die-tagespost.de', canonical_url)) {
hide = 'section#footer-popup';
} else if (matchUrlDomain('lkz.de', canonical_url)) {
let article_hidden = document.querySelector('div#main');
if (article_hidden)
article_hidden.removeAttribute('id');
hide = 'div.nfy-element-ad, div.error-screen';
} else if (matchUrlDomain('main-echo.de', canonical_url)) {
let hidden_elems = document.querySelectorAll('[hidden]');
for (let elem of hidden_elems)
elem.removeAttribute('hidden');
hide = 'div[id^="traffective-ad-"]';
} else if (matchUrlDomain('mainpost.de', canonical_url)) {
hide = 'div.aa-first-layer';
} else if (matchUrlDomain(['noz.de', 'shz.de'], canonical_url)) {
hide = 'div.msn-ads';
}
} else if (hostname.endsWith('.fi')) {
if (matchUrlDomain(['aamulehti.fi', 'hs.fi', 'is.fi'], canonical_url)) {
hide = 'header, footer, div.article-actions, div.skip-link, article.list, iframe[data-testid="iframe-embed"]';
let image_containers = document.querySelectorAll('div.aspect-ratio-container');
for (let elem of image_containers)
elem.classList.remove('aspect-ratio-container');
}
} else if (hostname.endsWith('.fr')) {
if (matchUrlDomain('humanite.fr', canonical_url)) {
hide = 'tab-bar-component, div#form_don';
}
} else {
if (matchUrlDomain(['businesslive.co.za', 'timeslive.co.za'], canonical_url)) {
hide = 'div#gdpr-overlay';
} else if (matchUrlDomain('ibj.com', canonical_url)) {
hide = 'header#masthead, nav, footer, aside#secondary, div.article-audio, div.article-left-rail, div.promo-container, div.toolbar';
} else if (matchUrlDomain('investorschronicle.co.uk', canonical_url)) {
hide = 'div#specialist__renderer--header';
} else if (matchUrlDomain('nouvelobs.com', canonical_url)) {
hide = 'div.paywall';
} else if (matchUrlDomain('repubblica.it', canonical_url)) {
hide = 'div.cookiewall, div[data-src^="//box.kataweb.it/"]';
} else if (matchUrlDomain('telecompaper.com', canonical_url)) {
hide = 'div[role="dialog"]';
}
}
} else {
if (document.querySelector('head > link[as="image"][imagesrcset^="https://photos.watchmedier.dk/"]')) {// ###_dk_watch_media
hide = 'header, footer, img, svg, section[data-sentry-component="ListCard"]';
}
}
if (hide)
hideDOMStyle(hide);
}
}
function matchDomain(domains, hostname = window.location.hostname) {
let matched_domain = false;
if (typeof domains === 'string')
domains = [domains];
domains.some(domain => (hostname === domain || hostname.endsWith('.' + domain)) && (matched_domain = domain));
return matched_domain;
}
function urlHost(url) {
if (/^http/.test(url)) {
try {
return new URL(url).hostname;
} catch (e) {
console.log(`url not valid: ${url} error: ${e}`);
}
}
return url;
}
function matchUrlDomain(domains, url) {
return matchDomain(domains, urlHost(url));
}
function hideDOMStyle(selector, id = 1) {
let style = document.querySelector('head > style#ext'+ id);
if (!style && document.head) {
let sheet = document.createElement('style');
sheet.id = 'ext' + id;
sheet.innerText = selector + ' {display: none !important;}';
document.head.appendChild(sheet);
}
}
function correctLinks(hostname) {
let links = document.querySelectorAll('a[href^="/"], link[rel="stylesheet"][href^="/"]');
for (let elem of links)
elem.href = elem.href.replace('codebeautify.org', hostname);
}
function unhideHostImages(hostname) {
let hidden_images = document.querySelectorAll('img[src^="/"]');
for (let elem of hidden_images) {
elem.src = elem.src.replace('codebeautify.org', hostname);
elem.removeAttribute('srcset');
let sources = elem.parentNode.querySelectorAll('source[srcset]');
for (let source of sources)
source.removeAttribute('srcset');
}
}
function unhideDataImages() {
let hidden_images = document.querySelectorAll('img[src^="data:image/"]');
for (let elem of hidden_images) {
if (elem.getAttribute('data-src'))
elem.src = elem.getAttribute('data-src');
else if (elem.parentNode) {
let source = elem.parentNode.querySelector('source[data-srcset]');
if (source) {
elem.src = source.getAttribute('data-srcset').split(/[\?\s]/)[0];
}
}
}
}

2
options/offscreen.html Normal file
View file

@ -0,0 +1,2 @@
<!doctype html>
<script src="offscreen.js"></script>

19
options/offscreen.js Normal file
View file

@ -0,0 +1,19 @@
var ext_api = (typeof browser === 'object') ? browser : chrome;
ext_api.runtime.onMessage.addListener(handleMessages);
async function handleMessages(message) {
if (message.request === 'getExtSrc_dom')
getExtSrc_dom(message.data);
}
function getExtSrc_dom(data) {
let parser = new DOMParser();
let doc = parser.parseFromString(data.html, 'text/html');
let article_new = doc.querySelector(data.selector_source);
data.html = article_new ? article_new.outerHTML : '';
sendToBackground('getExtSrc_dom_result', data);
}
function sendToBackground(request, data) {
ext_api.runtime.sendMessage({request, data});
}

7
options/optin/opt-in.css Normal file
View file

@ -0,0 +1,7 @@
html, body {
padding-left: 0.5em;
padding-right: 0.5em;
}
button {
margin: 0.2em 0.2em 0.5em 0;
}

56
options/optin/opt-in.html Normal file
View file

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bypass Paywalls Clean (custom sites, check update & setCookie opt-in)</title>
<link rel="stylesheet" href="../options_all.css"/>
<link rel="stylesheet" href="opt-in.css"/>
<script src="opt-in.js"></script>
</head>
<body>
<div>
<p><strong>Bypass Paywalls Clean<br> - custom sites, check update & setCookie opt-in</strong></p>
</div>
</div>
<div id="custom-prompt">
<p><strong>custom sites opt-in</strong></p>
<p>If you want to enable custom sites and also have the option to remove cookies/block general paywall-scripts of 'unlisted' sites:</br>
<p>custom sites enabled: <span id="custom-enabled"></span></p>
<div id="custom-container">
<button id="custom-enable">Enable</button>
<button id="custom-disable">Disable</button>
<span id="mv3-remove-perm-msg" style="color: red;">
</div>
<p>You can also just request permissions for the <a href="../options_custom.html">custom sites</a> you added yourself.</p>
</div>
<div id="update-prompt">
<p><strong>check update opt-in</strong></p>
<p>Check for update of version (on startup and when opening options):</br>
<p>check update enabled: <span id="update-enabled"></span></p>
<div id="update-container">
<button id="update-enable">Enable</button>
<button id="update-disable">Disable</button>
</div>
</div>
<div id="opt-in-prompt">
<p><strong>setCookie opt-in</strong></p>
<p>For some sites a necessary cookie has to be set (this cookie doesn't contain any personal information about the user or device):<br><br>
None</p>
<p>setCookie opt-in enabled: <span id="opt-in-enabled"></span></p>
<div id="optin-container">
<button id="optin-enable">Enable</button>
<button id="optin-disable">Disable</button>
</div>
<p>
<div style='float:left;padding-bottom:50px'>
<small><button><a href="../options.html" style="text-decoration:none;color:inherit">Options</a></button></small>
<small><button><a href="../options_custom.html" style="text-decoration:none;color:inherit">Custom sites</a></button></small>
<small><button id="button-close">Close</button></small>
</div>
</p>
</body>
</html>

112
options/optin/opt-in.js Normal file
View file

@ -0,0 +1,112 @@
var ext_api = (typeof browser === 'object') ? browser : chrome;
var url_loc = (typeof browser === 'object') ? 'firefox' : 'chrome';
var manifestData = ext_api.runtime.getManifest();
var ext_manifest_version = manifestData.manifest_version;
var navigator_ua = navigator.userAgent;
var navigator_ua_mobile = navigator_ua.toLowerCase().includes('mobile');
var chrome_android_browser = navigator_ua_mobile && (url_loc === 'chrome') && !navigator_ua.toLowerCase().includes('yabrowser');
var custom_switch = ((manifestData.optional_permissions && manifestData.optional_permissions.length) || (manifestData.optional_host_permissions && manifestData.optional_host_permissions.length)) && !chrome_android_browser;
window.addEventListener("load", function () {
document.getElementById("button-close").addEventListener("click", function () {
ext_api.storage.local.set({
"optInShown": true,
"customShown": true
});
window.close();
});
var opt_in_enabled = document.getElementById('opt-in-enabled');
ext_api.storage.local.get("optIn", function (result) {
opt_in_enabled.innerText = result.optIn ? 'YES' : 'NO';
});
var mv3_remove_perm_msg = document.getElementById('mv3-remove-perm-msg');
document.getElementById("optin-enable").addEventListener("click", function () {
ext_api.storage.local.set({
"optIn": true,
"optInShown": true
});
opt_in_enabled.innerText = 'YES';
});
document.getElementById("optin-disable").addEventListener("click", function () {
ext_api.storage.local.set({
"optIn": false,
"optInShown": true
});
opt_in_enabled.innerText = 'NO';
});
var custom_enabled = document.getElementById('custom-enabled');
ext_api.permissions.contains({
origins: ["*://*/*"]
}, function (result) {
if (result) {
custom_enabled.innerText = 'YES';
} else {
custom_enabled.innerText = 'NO';
}
});
if (custom_switch) {
document.querySelector('#custom-enable').addEventListener('click', function (event) {
ext_api.permissions.request({
origins: ["*://*/*"]
}, function (granted) {
if (granted) {
custom_enabled.innerText = 'YES';
ext_api.storage.local.set({
"customOptIn": true
});
if (ext_manifest_version === 3)
mv3_remove_perm_msg.innerText = '';
} else {
custom_enabled.innerText = 'NO';
}
ext_api.storage.local.set({
"customShown": true
});
});
});
document.querySelector('#custom-disable').addEventListener('click', function (event) {
ext_api.permissions.remove({
origins: ["*://*/*"]
}, function (removed) {
if (removed) {
custom_enabled.innerText = 'NO';
ext_api.storage.local.set({
"customOptIn": false
});
if (ext_manifest_version === 3)
mv3_remove_perm_msg.innerText = 'Reload extension on removal of optional host permissions';
}
ext_api.storage.local.set({
"customShown": true
});
});
});
}// custom_switch
var update_enabled = document.getElementById('update-enabled');
ext_api.storage.local.get({optInUpdate: true}, function (result) {
update_enabled.innerText = result.optInUpdate ? 'YES' : 'NO';
});
document.getElementById("update-enable").addEventListener("click", function () {
ext_api.storage.local.set({
"optInUpdate": true
});
update_enabled.innerText = 'YES';
});
document.getElementById("update-disable").addEventListener("click", function () {
ext_api.storage.local.set({
"optInUpdate": false
});
update_enabled.innerText = 'NO';
});
});

51
options/options.html Normal file
View file

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bypass Paywalls Clean Options</title>
<link rel="stylesheet" href="options_all.css"/>
</head>
<body>
<h1 id="top">Options | <small><span id="version"></span><br><span id="version_new"></span></small></h1>
Changelog <a href="/changelog.txt" target="_blank">local</a> or <a href="https://gitflic.ru/project/magnolia1234/bypass-paywalls-chrome-clean/blob/raw?file=changelog.txt" target="_blank">online</a>
| Help <a href="/Readme.html" target="_blank">local</a> or <a href="https://gitflic.ru/project/magnolia1234/bypass-paywalls-chrome-clean" target="_blank">online</a>
<div style="width:90%;">
<br>Some selected sites will have their cookies cleared; uncheck the sites (or add to excluded sites) for which you have an account.<br>
If you also want to block general paywall-scripts for unlisted sites you have to opt-in to custom sites (host permission for access to all sites is needed).
<!-- To view some sites (check list) a necessary cookie has to be set (enable this in opt-in). -->
</div>
<br>
<div style='float:left'>
<small><button id="save_top">Save</button></small>
<small><button><a href="options_custom.html" style="text-decoration:none;color:inherit">Custom sites</a></button></small>
<small><button><a href="optin/opt-in.html" style="text-decoration:none;color:inherit">Opt-in</a></button></small>
<small><button id="check_sites_updated">Check updated sites</button></small>
<small><button id="clear_sites_updated">Clear updated sites</button></small>
<small><button><a href="options_excluded.html" style="text-decoration:none;color:inherit">Excluded sites</a></button></small>
<small><button><a href="#save" style="text-decoration:none;color:inherit">Go to bottom</a></button></small>
<input id="search" type="text" size="30" placeholder="Search (domain)name ...">
</div>
<div style="clear:both;"></div>
<strong style="color:red;"><div id="perm-custom"></div></strong>
<div style="clear:both;"></div>
<br>
<div id="status_top"></div>
<div id='bypass_sites'></div>
<br>
<div id="status"></div>
<div id="error"></div>
<span style='float:left;padding-bottom:50px'>
<button id="save">Save</button>
<button id="select-all">Select all</button>
<button id="select-none">Select none</button>
<button><a href="options_custom.html" style="text-decoration:none;color:inherit">Custom sites</a></button>
<button><a href="options_excluded.html" style="text-decoration:none;color:inherit">Excluded sites</a></button>
<button><a href="#top" style="text-decoration:none;color:inherit">Go to top</a></button>
<button id="button-close">Close</button>
</span>
<script src="../sites.js"></script>
<script src="options.js"></script>
<script src="version.js"></script>
</body>
</html>

228
options/options.js Normal file
View file

@ -0,0 +1,228 @@
var ext_api = (typeof browser === 'object') ? browser : chrome;
// Saves options to ext_api.storage
function save_options(event) {
var inputEls = document.querySelectorAll('#bypass_sites input');
var sites = {};
var sites = Array.from(inputEls).reduce(function (memo, inputEl) {
if (inputEl.checked) {
memo[inputEl.dataset.key] = inputEl.dataset.value;
}
return memo;
}, {});
ext_api.storage.local.set({
sites: sites
}, function () {
// Update status to let user know options were saved.
if (event) {
var status_label = document.querySelectorAll('[id^="status"]');
for (let status of status_label) {
status.textContent = 'Options saved.';
setTimeout(function () {
status.textContent = '';
}, 800);
}
}
});
}
// Restores checkbox input states using the preferences stored in ext_api.storage.
function renderOptions() {
var labelEl;
ext_api.storage.local.get({
sites: {},
sites_updated: {},
sites_custom: {},
sites_excluded: []
}, function (items) {
var sites = items.sites;
var sites_updated = filterObject(items.sites_updated, function (val, key) {
return !val.nofix
});
var sites_updated_domains_new = Object.values(sites_updated).filter(x => (x.domain && !defaultSites_domains.includes(x.domain) || x.group)).map(x => x.group ? x.group.filter(y => !defaultSites_domains.includes(y)) : x.domain).flat();
var sites_updated_perm_domains_new = Object.values(sites_updated).filter(x => x.block_host_perm_add).map(x => x.block_host_perm_add.split(',').filter(x => x).map(x => x.trim())).flat();
var sites_custom = items.sites_custom;
var sites_custom_domains_new = Object.values(sites_custom).filter(x => x.domain && !defaultSites_domains.includes(x.domain)).map(x => x.group ? x.group.split(',').map(x => x.trim()) : x.domain).flat();
var sites_custom_perm_domains_new = Object.values(sites_custom).filter(x => x.block_host_perm_add).map(x => x.block_host_perm_add.split(',').filter(x => x).map(x => x.trim())).flat();
var perm_origins = sites_custom_domains_new.concat(sites_updated_domains_new, sites_custom_perm_domains_new, sites_updated_perm_domains_new).filter(x => !x.includes('###')).map(x => '*://*.' + x + '/*');
var perm_custom = document.getElementById('perm-custom');
ext_api.permissions.contains({
origins: perm_origins
}, function (result) {
if (result) {
perm_custom.innerText = '';
} else {
perm_custom.textContent = ">> check host (domain) permissions for custom/updated sites";
}
});
var sites_excluded = items.sites_excluded;
var sitesEl = document.getElementById('bypass_sites');
var site_types = {
"updated": {
sites: sites_updated,
title: '* Updated (new) sites (opt-in to custom sites)',
default_sites: false
},
"default": {
sites: defaultSites,
title: '* Default settings',
default_sites: true
},
"custom": {
sites: sites_custom,
title: '* Custom (new) sites',
default_sites: false
}
};
for (let site_type in site_types) {
labelEl = document.createElement('label');
labelEl.setAttribute('style', ' font-weight: bold;');
if (site_types[site_type].title) {
labelEl.appendChild(document.createElement('hr'));
labelEl.appendChild(document.createTextNode(site_types[site_type].title));
if (site_type !== 'updated' && Object.keys(site_types[site_type].sites).length)
labelEl.appendChild(document.createTextNode(' - #' + Object.keys(site_types[site_type].sites).length));
}
sitesEl.appendChild(labelEl);
let sites_arr = site_types[site_type].sites;
for (let key in sites_arr) {
let domain = sites_arr[key]['domain'];
if (!domain || (key === '###_remove_sites') || (!site_types[site_type].default_sites && (defaultSites.hasOwnProperty(key) || defaultSites_domains.includes(domain))))
continue;
labelEl = document.createElement('label');
let inputEl = document.createElement('input');
inputEl.type = 'checkbox';
inputEl.dataset.key = key;
inputEl.dataset.value = domain;
inputEl.checked = Object.keys(sites).some(title => compareKey(title, key)) && !sites_excluded.includes(domain);
if (domain !== '###') {
labelEl.appendChild(inputEl);
} else {
labelEl.appendChild(document.createElement('hr'));
labelEl.setAttribute('style', ' font-weight: bold;');
}
labelEl.appendChild(document.createTextNode(' ' + key));
sitesEl.appendChild(labelEl);
}
}
// excluded
labelEl.appendChild(document.createElement('hr'));
labelEl = document.createElement('label');
labelEl.setAttribute('style', ' font-weight: bold;');
labelEl.appendChild(document.createTextNode('* Excluded Sites (domain(s) ignored when checked in list)'));
sitesEl.appendChild(labelEl);
labelEl = document.createElement('label');
labelEl.appendChild(document.createTextNode(sites_excluded.join()));
sitesEl.appendChild(labelEl);
save_options();
});
}
function handleSearch() {
let search = document.getElementById('search').value.toLowerCase().replace('www.', '');
let listItems = document.querySelectorAll('#bypass_sites > label');
grouped_sites = filterObject(grouped_sites, function (val, key) {
return val.length
});
ext_api.storage.local.get({
sites_updated: {},
sites_custom: {}
}, function (items) {
let sites_updated_groups = filterObject(items.sites_updated, function (val, key) {
return val.group
}, function (val, key) {
return [val.domain, val.group]
});
for (let site in sites_updated_groups) {
let site_default = Object.keys(defaultSites).find(key => compareKey(key, site)) || site;
grouped_sites[site_default] = sites_updated_groups[site];
}
let sites_custom_groups = filterObject(items.sites_custom, function (val, key) {
return val.group
}, function (val, key) {
return [val.domain, val.group.split(',')]
});
for (let site in sites_custom_groups)
grouped_sites[site] = sites_custom_groups[site];
for (let item of listItems) {
let itemText = item.textContent.toLowerCase();
let itemInput = item.querySelector('input[data-value]');
let itemDomain = itemInput ? itemInput.getAttribute('data-value') : '';
let itemGroup = itemDomain ? grouped_sites[itemDomain] : '';
if (itemText.includes(search) || !itemDomain || (itemDomain && (itemDomain.match(/^(###$|#options_[^d])/) || itemDomain.includes(search) || (itemGroup && itemGroup.includes(search)))))
item.style.display = 'block';
else
item.style.display = 'none';
}
});
let selectButtons = document.querySelectorAll('#select-all, #select-none');
for (let elem of selectButtons) {
if (search == '')
elem.style.display = 'block';
else
elem.style.display = 'none';
}
}
function selectAll() {
var inputEls = Array.from(document.querySelectorAll('input[data-key]'));
inputEls = inputEls.filter(function (input) {
return (!input.dataset.value.match(/^#options_(disable|optin)_/));
});
inputEls.forEach(function (inputEl) {
inputEl.checked = true;
});
// Update status to let user know all sites are selected.
var status = document.getElementById('status');
status.textContent = 'All sites selected.';
setTimeout(function () {
status.textContent = '';
}, 800);
}
function selectNone() {
var inputEls = Array.from(document.querySelectorAll('input'));
inputEls.forEach(function(inputEl) {
inputEl.checked = false;
});
}
function closeButton() {
window.close();
}
function check_sites_updated() {
ext_api.runtime.sendMessage({request: 'check_sites_updated'});
location.reload();
}
function clear_sites_updated() {
ext_api.runtime.sendMessage({request: 'clear_sites_updated'});
location.reload();
}
function compareKey(firstStr, secondStr) {
return firstStr.toLowerCase().replace(/\s\(.*\)/, '') === secondStr.toLowerCase().replace(/\s\(.*\)/, '');
}
function filterObject(obj, filterFn, mapFn = function (val, key) {
return [key, val];
}) {
return Object.fromEntries(Object.entries(obj).
filter(([key, val]) => filterFn(val, key)).map(([key, val]) => mapFn(val, key)));
}
document.addEventListener('DOMContentLoaded', renderOptions);
document.getElementById('save').addEventListener('click', save_options);
document.getElementById('save_top').addEventListener('click', save_options);
document.getElementById('select-all').addEventListener('click', selectAll);
document.getElementById('select-none').addEventListener('click', selectNone);
document.getElementById('button-close').addEventListener('click', closeButton);
document.getElementById('check_sites_updated').addEventListener('click', check_sites_updated);
document.getElementById('clear_sites_updated').addEventListener('click', clear_sites_updated);
document.getElementById('search').addEventListener('input', handleSearch);

21
options/options_all.css Normal file
View file

@ -0,0 +1,21 @@
#bypass_sites label, #add_site label, #excluded_sites label {
display: block;
}
body {
font-size: 100%;
}
* {
box-sizing: border-box;
}
a {
color: black;
}
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
body, button, a, input, select, textarea {
background-color: #313131;
color: #bfbfbf;
}
}

View file

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bypass Paywalls Clean Options Custom</title>
<link rel="stylesheet" href="options_all.css"/>
</head>
<body>
<h2>Custom Sites</h2>
<div style="width:90%;">
To add a new site, enter an unique title/domain (without www.).<br>
Select options below (<a href="/README.html#add-custom-site" target="_blank">see help</a>); for examples import from online.<br>
Custom sites (new) are enabled automatically in <small><button><a href="options.html" style="text-decoration:none;color:inherit">Options</a></button></small> (cookies will be blocked by default unless you enable allow_cookies).<br>
If you want to use custom sites (for unlisted sites) enable it in <small><button><a href="optin/opt-in.html" style="text-decoration:none;color:inherit">Opt-in</a></button></small>
<strong>Custom sites enabled: <span id="custom-enabled"></span></strong><br>
You can also just request host permissions for the custom sites & post-release added sites (below).<br>
If host permission is missing the icon badge will contain a 'C' (or '+C' if you can import the custom site from online; when no fix X).
<br><br>
</div>
<div id='add_site'></div>
<br>
<div id="status_add"></div>
<span style='float:left;padding-bottom:5px'>
<button id="add">Add</button>
</span>
<div style="clear:both;"></div>
<div>
<h3>List of custom sites</h3>
* already in default list (double domain)
<br>
</div>
<div id='custom_sites'></div>
<br>
<div id="status_delete"></div>
<span style='float:left;padding-bottom:5px'>
<button id="delete">Delete</button>
<button id="edit">Edit (re-Add)</button>
<button id="delete_default">Delete<br>default (*) sites</button>
<button id="perm_request">Request<br>permissions</button>
<button id="perm_remove">Remove<br>permissions</button>
<input id="search" type="text" size="30" placeholder="Search (domain)name ..."><br><br>
permissions granted (for all in custom list + updated): <strong><span id="perm-custom"></span></strong>
</span>
<div style="clear:both;"></div>
<div style="width:90%;">
<h3>Json file</h3>
You can edit/sort the text area and save (only when json-text is valid).
Clear & save to reset. You can also export/import json-text for new installations.
</div>
<br>
<div id='bypass_sites'></div>
<br>
<div id="status"></div>
<div id="error"></div>
<span style='float:left;padding-bottom:50px'>
<button id="save">Save</button>
<button id="sort">Sort</button>
<button id="export">Export</button>
<button id="import">Import file</button>
<button id="import_local">Import from local</button>
<button id="import_online">Import from online</button>
<input type="file" id="importInput" accept=".txt, .json" style="display:none"/>
<button><a href="options.html" style="text-decoration:none;color:inherit">Options</a></button>
</span>
<script src="../sites.js"></script>
<script src="options_custom.js"></script>
</body>
</html>

560
options/options_custom.js Normal file
View file

@ -0,0 +1,560 @@
var ext_api = (typeof browser === 'object') ? browser : chrome;
var url_loc = (typeof browser === 'object') ? 'firefox' : 'chrome';
var manifestData = ext_api.runtime.getManifest();
var navigator_ua = navigator.userAgent;
var navigator_ua_mobile = navigator_ua.toLowerCase().includes('mobile');
var chrome_android_browser = navigator_ua_mobile && (url_loc === 'chrome') && !navigator_ua.toLowerCase().includes('yabrowser');
var custom_switch = ((manifestData.optional_permissions && manifestData.optional_permissions.length) || (manifestData.optional_host_permissions && manifestData.optional_host_permissions.length)) && !chrome_android_browser;
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', 'google_search_tool'];
function capitalize(str) {
return (typeof str === 'string') ? str.charAt(0).toUpperCase() + str.slice(1) : '';
}
function sortJson(json) {
return Object.keys(json)
.sort().reduce(function (Obj, key) {
Obj[key] = json[key];
return Obj;
}, {});
}
function filterObject(obj, filterFn, mapFn = function (val, key) {
return [key, val];
}) {
return Object.fromEntries(Object.entries(obj).
filter(([key, val]) => filterFn(val, key)).map(([key, val]) => mapFn(val, key)));
}
// Saves options to ext_api.storage
function save_options() {
var textareaEl = document.querySelector('#bypass_sites textarea');
var sites_custom = {};
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)
});
}
ext_api.storage.local.set({
sites_custom: sites_custom
}, function () {
// Update status to let user know custom sites were saved.
var status = document.getElementById('status');
status.textContent = 'Custom sites saved.';
setTimeout(function () {
status.textContent = '';
location.href = 'options.html';
//window.close();
}, 800);
});
}
// Sort json by key in textarea
function sort_options() {
var textareaEl = document.querySelector('#bypass_sites textarea');
var sites_custom = {};
if (textareaEl.value) {
var sites_custom = JSON.parse(textareaEl.value);
var sites_custom_sorted = sortJson(sites_custom);
textareaEl.value = JSON.stringify(sites_custom_sorted);
}
}
// Export custom sites to file
function export_options() {
ext_api.storage.local.get({
sites_custom: {}
}, function (items) {
var result = JSON.stringify(items.sites_custom);
var a = document.createElement("a");
var file = new Blob([result], {type: "text/plain"});
a.href = window.URL.createObjectURL(file);
let date = new Date();
let dateStr = new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toISOString().split("T")[0];
a.download = 'bypass_paywalls_clean_custom_' + dateStr + '.txt';
a.click();
});
}
function import_json(result) {
ext_api.storage.local.get({
sites_custom: {}
}, function (items) {
var sites_custom = items.sites_custom;
var sites_custom_new = JSON.parse(result);
var customSitesExt_remove = [];
if (sites_custom_new['###_remove_sites'] && sites_custom_new['###_remove_sites'].cs_code)
customSitesExt_remove = sites_custom_new['###_remove_sites'].cs_code.split(/,\s?/);
for (let site in sites_custom_new) {
let customSite_diff = Object.keys(sites_custom).find(key => sites_custom[key].domain === sites_custom_new[site].domain && key !== site);
if (customSite_diff)
delete sites_custom[customSite_diff];
if (sites_custom_new[site].group) {
let group = sites_custom_new[site].group;
let customSites_group = Object.keys(sites_custom).filter(key => group.split(',').includes(sites_custom[key].domain));
for (let key of customSites_group)
delete sites_custom[key];
}
sites_custom[site] = sites_custom_new[site];
}
sites_custom = filterObject(sites_custom, function (val, key) {
return !(customSitesExt_remove.includes(val.domain) || (val.add_ext_link && !val.add_ext_link_type))
});
ext_api.storage.local.set({
sites_custom: sortJson(sites_custom)
}, function () {
// Update status to let user know custom sites were imported.
var status = document.getElementById('status');
status.textContent = 'Custom sites imported.';
setTimeout(function () {
//status.textContent = '';
importInput.value = '';
renderOptions();
}, 800);
});
});
}
// Import custom sites from local/online
function import_url_options(e, online) {
let url = '/custom/sites_custom.json';
if (online)
url = 'https://gitflic.ru/project/magnolia1234/bpc_updates/blob/raw?file=sites_custom.json';
try {
fetch(url)
.then(response => {
if (response.ok) {
response.text().then(result => {
import_json(result);
})
}
});
} catch (err) {
console.log(err);
}
}
// Import custom sites from file
function import_options(e) {
var files = e.target.files;
var reader = new FileReader();
reader.onload = _imp;
reader.readAsText(files[0]);
}
function _imp() {
var result = this.result;
import_json(result);
}
// Add custom site to ext_api.storage
function add_options() {
var inputEls = document.querySelectorAll('#add_site input, #add_site select, #add_site textarea');
var sites_custom = {};
for (let elem of inputEls) {
if (elem.dataset.key === 'title') {
var title = capitalize(elem.value);
if (!title)
break;
sites_custom[title] = {};
} else {
if (elem.dataset.value) {
if (elem.checked)
sites_custom[title][elem.dataset.key] = parseInt(elem.dataset.value);
} else if (elem.value) {
if (['block_host_perm_add', 'group'].includes(elem.dataset.key))
elem.value = elem.value.replace(/,{2,}/g, ',').replace(/(\s|www\.|,$)/g, '');
sites_custom[title][elem.dataset.key] = elem.value;
}
}
}
if (title && sites_custom[title]['domain']) {
sites_custom[title]['domain'] = sites_custom[title]['domain'].replace(/(http(s)?:\/\/|\/$)/g, '').replace(/^(www|amp(html)?|m|wap)(\d)?\./, '').toLowerCase();
// add new site to local storage
ext_api.storage.local.get({
sites_custom: {}
}, function (items) {
var sites_custom_old = items.sites_custom;
for (var key in sites_custom) {
sites_custom_old[key] = sites_custom[key];
}
ext_api.storage.local.set({
sites_custom: sites_custom_old
}, function () {
// Update status to let user know new custom site was added.
var status_add = document.getElementById('status_add');
status_add.textContent = 'Site added.';
setTimeout(function () {
//status.textContent = '';
renderOptions();
}, 800);
});
});
}
}
// Delete custom site from ext_api.storage
function delete_options() {
var selectEl = document.querySelector('#custom_sites select');
var sites_custom = {};
var remove_key = selectEl.value;
if (!remove_key)
return false;
// delete site from local storage
ext_api.storage.local.get({
sites_custom: {}
}, function (items) {
var sites_custom_old = items.sites_custom;
delete sites_custom_old[remove_key];
ext_api.storage.local.set({
sites_custom: sites_custom_old
}, function () {
// Update status to let user know custom site was deleted.
var status_delete = document.getElementById('status_delete');
status_delete.textContent = 'Site deleted.';
setTimeout(function () {
//status.textContent = '';
renderOptions();
}, 800);
});
});
}
// Delete custom (& default) sites from ext_api.storage
function delete_default_options() {
ext_api.storage.local.get({
sites_custom: {}
}, function (items) {
sites_custom = filterObject(items.sites_custom, function (val, key) {
return !defaultSites_domains.includes(val.domain);
});
ext_api.storage.local.set({
sites_custom: sites_custom
}, function () {
// Update status to let user know custom & default sites were deleted.
var status_delete = document.getElementById('status_delete');
status_delete.textContent = 'Default sites deleted.';
setTimeout(function () {
//status.textContent = '';
renderOptions();
}, 800);
});
});
}
// Edit custom site (copy to add)
function edit_options() {
var selectEl = document.querySelector('#custom_sites select');
var sites_custom = {};
var title = selectEl.value;
if (!title)
return false;
// copy site to add-fields
ext_api.storage.local.get({
sites_custom: {}
}, function (items) {
sites_custom = items.sites_custom;
var edit_site = sites_custom[title];
document.querySelector('input[data-key="title"]').value = title;
document.querySelector('input[data-key="domain"]').value = edit_site.domain;
document.querySelector('textarea[data-key="group"]').value = edit_site.group || '';
document.querySelector('input[data-key="allow_cookies"]').checked = (edit_site.allow_cookies > 0);
document.querySelector('input[data-key="remove_cookies"]').checked = (edit_site.remove_cookies > 0);
document.querySelector('select[data-key="useragent"]').selectedIndex = useragent_options.indexOf(edit_site.useragent);
document.querySelector('textarea[data-key="useragent_custom"]').value = edit_site.useragent_custom || '';
document.querySelector('select[data-key="referer"]').selectedIndex = referer_options.indexOf(edit_site.referer);
document.querySelector('textarea[data-key="referer_custom"]').value = edit_site.referer_custom || '';
document.querySelector('select[data-key="random_ip"]').selectedIndex = random_ip_options.indexOf(edit_site.random_ip);
document.querySelector('input[data-key="block_js"]').checked = (edit_site.block_js > 0);
document.querySelector('input[data-key="block_js_ext"]').checked = (edit_site.block_js_ext > 0);
document.querySelector('input[data-key="block_js_inline"]').value = edit_site.block_js_inline || '';
document.querySelector('input[data-key="block_regex"]').value = edit_site.block_regex || '';
document.querySelector('input[data-key="block_regex_ignore_default"]').checked = (edit_site.block_regex_ignore_default > 0 || edit_site.block_regex_ignore_default > 0);
document.querySelector('input[data-key="block_host_perm_add"]').value = edit_site.block_host_perm_add || '';
document.querySelector('input[data-key="amp_unhide"]').checked = (edit_site.amp_unhide > 0);
document.querySelector('input[data-key="amp_redirect"]').value = edit_site.amp_redirect || '';
document.querySelector('input[data-key="ld_json"]').value = edit_site.ld_json || '';
document.querySelector('input[data-key="ld_json_next"]').value = edit_site.ld_json_next || '';
document.querySelector('input[data-key="ld_json_source"]').value = edit_site.ld_json_source || '';
document.querySelector('input[data-key="ld_json_url"]').value = edit_site.ld_json_url || '';
document.querySelector('input[data-key="ld_archive_is"]').value = edit_site.ld_archive_is || '';
document.querySelector('input[data-key="add_ext_link"]').value = edit_site.add_ext_link || '';
document.querySelector('select[data-key="add_ext_link_type"]').selectedIndex = add_ext_link_type_options.indexOf(edit_site.add_ext_link_type);
document.querySelector('textarea[data-key="cs_code"]').value = edit_site.cs_code || '';
});
}
// request permissions for custom sites (in list only)
function request_permissions() {
var perm_custom = document.getElementById('perm-custom');
ext_api.permissions.request({
origins: perm_origins
}, function (granted) {
if (granted) {
perm_custom.innerText = 'YES';
} else {
perm_custom.innerText = 'NO';
}
});
}
// remove permissions for custom sites
function remove_permissions() {
var perm_custom = document.getElementById('perm-custom');
ext_api.permissions.remove({
origins: perm_origins
}, function (removed) {
if (removed) {
perm_custom.innerText = 'NO';
}
});
}
var perm_origins;
// Restores checkbox input states using the preferences stored in ext_api.storage.
function renderOptions() {
ext_api.storage.local.get({
sites_custom: {},
sites_updated: {}
}, function (items) {
var sites_custom = sortJson(items.sites_custom);
var sites_custom_domains_new = Object.values(sites_custom).filter(x => x.domain && !defaultSites_domains.includes(x.domain)).map(x => x.group ? x.group.split(',').filter(x => x).map(x => x.trim()) : x.domain).flat();
var sites_custom_perm_domains_new = Object.values(sites_custom).filter(x => x.block_host_perm_add).map(x => x.block_host_perm_add.split(',').filter(x => x).map(x => x.trim())).flat();
var sites_updated = filterObject(items.sites_updated, function (val, key) {
return !val.nofix
});
var sites_updated_domains_new = Object.values(sites_updated).filter(x => (x.domain && !defaultSites_domains.includes(x.domain) || x.group)).map(x => x.group ? x.group.filter(y => !defaultSites_domains.includes(y)) : x.domain).flat();
var sites_updated_perm_domains_new = Object.values(sites_updated).filter(x => x.block_host_perm_add).map(x => x.block_host_perm_add.split(',').filter(x => x).map(x => x.trim())).flat();
var sitesEl = document.getElementById('bypass_sites');
sitesEl.innerHTML = '';
var labelEl = document.createElement('label');
var textareaEl = document.createElement('textarea');
textareaEl.value = JSON.stringify(sites_custom);
textareaEl.rows = 12;
textareaEl.cols = 40;
labelEl.appendChild(textareaEl);
sitesEl.appendChild(labelEl);
// add site
var add_sitesEl = document.getElementById('add_site');
add_sitesEl.innerHTML = '';
var inputEl;
var add_checkboxes = {
'title': 0,
'domain': 0,
'group': 0,
'allow_cookies': 1,
'remove_cookies': 1,
'useragent': 0,
'useragent_custom': 0,
'referer': 0,
'referer_custom': 0,
'random_ip': 0,
'block_js (domain)': 1,
'block_js_ext': 1,
'block_js_inline': 0,
'block_regex (add to default)': 0,
'block_regex_ignore_default': 1,
'block_host_perm_add': 0,
'amp_unhide': 1,
'amp_redirect': 0,
'ld_json': 0,
'ld_json_next': 0,
'ld_json_source': 0,
'ld_json_url': 0,
'ld_archive_is': 0,
'add_ext_link': 0,
'add_ext_link_type': 0,
'cs_code': 0,
};
var add_options = {
useragent: useragent_options,
referer: referer_options,
random_ip: random_ip_options,
add_ext_link_type: add_ext_link_type_options
};
for (var key in add_checkboxes) {
if (add_checkboxes[key]) {
inputEl = document.createElement('input');
inputEl.type = 'checkbox';
inputEl.dataset.value = 1;
} else {
if (add_options[key]) {
inputEl = document.createElement('select');
for (let elem of add_options[key]) {
let option = document.createElement("option");
option.value = elem;
option.text = elem;
inputEl.appendChild(option);
}
} else {
if (!['cs_code', 'group', 'referer_custom', 'useragent_custom'].includes(key)) {
inputEl = document.createElement('input');
inputEl.size = 35;
} else {
inputEl = document.createElement('textarea');
inputEl.rows = 5;
inputEl.cols = 35;
}
let placeholders = {
title: 'Example',
domain: 'example.com',
group: 'example1.com,example2.com',
block_js_inline: '\\.example\\.com\\/article\\/',
block_regex: '\\.example\\.com\\/js\\/',
block_host_perm_add: 'example1.com,example2.com',
amp_redirect: 'div.paywall|amp_url',
ld_json: 'div.paywall|div.article',
ld_json_next: 'div.paywall|div.article',
ld_json_source: 'div.paywall|div.article|filter|json_key',
ld_json_url: 'div.paywall|div.article',
ld_archive_is: 'div.paywall|div.art|div.art_src|div.art_link',
add_ext_link: 'div.paywall|div.article',
cs_code: 'for dev: check imported examples',
};
if (placeholders[key])
inputEl.placeholder = placeholders[key];
}
}
labelEl = document.createElement('label');
labelEl.style = 'margin: 2px 0px;';
inputEl.dataset.key = key.split(' (')[0];
labelEl.appendChild(inputEl);
labelEl.appendChild(document.createTextNode(' ' + key));
add_sitesEl.appendChild(labelEl);
}
// list of custom sites
var custom_sitesEl = document.getElementById('custom_sites');
custom_sitesEl.innerHTML = '';
labelEl = document.createElement('label');
var selectEl = document.createElement('select');
selectEl.id = 'sites';
selectEl.size = 6;
var optionEl;
for (let key in sites_custom) {
optionEl = document.createElement('option');
let domain = sites_custom[key]['domain'];
let group = sites_custom[key]['group'];
let isDefaultSite = defaultSites_domains.includes(domain);
optionEl.text = isDefaultSite ? '*' : '';
optionEl.text += key;
if (!navigator_ua_mobile) {
optionEl.text += ': ' + domain +
(sites_custom[key]['allow_cookies'] > 0 ? ' | allow_cookies' : '') +
(sites_custom[key]['remove_cookies'] > 0 ? ' | remove_cookies' : '') +
(sites_custom[key]['useragent'] ? ' | useragent: ' + sites_custom[key]['useragent'] : '') +
(sites_custom[key]['useragent_custom'] ? ' | useragent_custom' : '') +
(sites_custom[key]['googlebot'] > 0 ? ' | googlebot' : '') +
(sites_custom[key]['referer'] ? ' | referer: ' + sites_custom[key]['referer'] : '') +
(sites_custom[key]['referer_custom'] ? ' | referer_custom' : '') +
(sites_custom[key]['random_ip'] ? ' | random_ip: ' + sites_custom[key]['random_ip'] : '') +
((sites_custom[key]['block_js'] > 0) ? ' | block_js' : '') +
((sites_custom[key]['block_js_ext'] > 0) ? ' | block_js_ext' : '') +
(sites_custom[key]['block_js_inline'] ? ' | block_js_inline' : '') +
(sites_custom[key]['block_regex'] ? ' | block_regex' : '') +
(sites_custom[key]['amp_unhide'] > 0 ? ' | amp_unhide' : '') +
(sites_custom[key]['amp_redirect'] ? ' | amp_redirect' : '') +
(sites_custom[key]['ld_json'] ? ' | ld_json' : '') +
(sites_custom[key]['ld_json_next'] ? ' | ld_json_next' : '') +
(sites_custom[key]['ld_json_source'] ? ' | ld_json_source' : '') +
(sites_custom[key]['ld_json_url'] ? ' | ld_json_url' : '') +
(sites_custom[key]['ld_archive_is'] ? ' | ld_archive_is' : '') +
(sites_custom[key]['add_ext_link'] && sites_custom[key]['add_ext_link_type'] ? ' | add_ext_link' : '') +
(sites_custom[key]['cs_code'] ? ' | cs_code' : '');
}
optionEl.value = key;
selectEl.add(optionEl);
}
labelEl.appendChild(selectEl);
custom_sitesEl.appendChild(labelEl);
if (sites_updated_domains_new.length > 0) {
labelEl = document.createElement('p');
labelEl.appendChild(document.createElement('label'));
labelEl.appendChild(document.createTextNode('Updated sites: ' + sites_updated_domains_new.concat(sites_updated_perm_domains_new).join(', ')));
custom_sitesEl.appendChild(labelEl);
}
perm_origins = sites_custom_domains_new.concat(sites_updated_domains_new, sites_custom_perm_domains_new, sites_updated_perm_domains_new).filter(x => !x.includes('###')).map(x => '*://*.' + x + '/*');
var perm_custom = document.getElementById('perm-custom');
ext_api.permissions.contains({
origins: perm_origins
}, function (result) {
if (result) {
perm_custom.innerText = 'YES';
} else {
perm_custom.innerText = 'NO';
}
});
});
var custom_enabled = document.getElementById('custom-enabled');
ext_api.permissions.contains({
origins: ["*://*/*"]
}, function (result) {
if (result) {
custom_enabled.innerText = 'YES';
} else {
custom_enabled.innerText = 'NO';
}
});
}
function handleSearch() {
let search = document.getElementById('search').value.toLowerCase().replace('www.', '');
let listItems = document.querySelectorAll('select#sites > option');
ext_api.storage.local.get({
sites_custom: {}
}, function (items) {
let sites_custom = items.sites_custom;
let grouped_sites = filterObject(sites_custom, function (val, key) {
return val.group
}, function (val, key) {
return [val.domain, val.group.split(',')]
});
for (let item of listItems) {
let itemDomain = sites_custom[item.value].domain;
let itemText = item.value.toLowerCase();
let itemGroup = itemDomain ? grouped_sites[itemDomain] : '';
if (itemText.includes(search) || (itemDomain.includes(search) || (itemGroup && itemGroup.includes(search))))
item.style.display = 'block';
else
item.style.display = 'none';
}
});
}
document.addEventListener('DOMContentLoaded', renderOptions);
document.getElementById('save').addEventListener('click', save_options);
document.getElementById('sort').addEventListener('click', sort_options);
document.getElementById('export').addEventListener('click', export_options);
document.getElementById('import').onclick = function () {importInput.click()}
document.getElementById('importInput').addEventListener("change", import_options, false);
document.getElementById('import_local').addEventListener('click', e => import_url_options(e, false));
document.getElementById('import_online').addEventListener('click', e => import_url_options(e, true));
document.getElementById('add').addEventListener('click', add_options);
document.getElementById('delete').addEventListener('click', delete_options);
document.getElementById('delete_default').addEventListener('click', delete_default_options);
document.getElementById('edit').addEventListener('click', edit_options);
document.getElementById('search').addEventListener('input', handleSearch);
if (custom_switch) {
document.getElementById('perm_request').addEventListener('click', request_permissions);
document.getElementById('perm_remove').addEventListener('click', remove_permissions);
}

View file

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bypass Paywalls Clean Options Excluded</title>
<link rel="stylesheet" href="options_all.css"/>
</head>
<body>
<h2>Excluded Sites</h2>
<div style="width:90%;">
Add excluded sites/domains (for your subscriptions) as a comma-separated list (www.-prefix and spaces are removed).<br>
You can also exclude a specific domain which is grouped in options.<br>
Checked sites in options are ignored (to still enable select all).<br>
</div>
<div style="clear:both;"></div>
<div style="width:90%;">
<h3>Sites</h3>
</div>
<br>
<div id='excluded_sites'></div>
<br>
<div id="status"></div>
<div id="error"></div>
<span style='float:left;padding-bottom:50px'>
<button id="save">Save</button>
<button id="sort">Sort</button>
<button><a href="options.html" style="text-decoration:none;color:inherit">Options</a></button>
</span>
<script src="options_excluded.js"></script>
</body>
</html>

View file

@ -0,0 +1,52 @@
var ext_api = chrome || browser;
// Saves options to ext_api.storage
function save_options() {
var textareaEl = document.querySelector('#excluded_sites textarea');
var sites_excluded = [];
if (textareaEl.value !== '')
var sites_excluded = textareaEl.value.split(',').filter(x => x).map(x => x.trim().replace('www.', ''));
ext_api.storage.local.set({
sites_excluded: sites_excluded
}, function () {
// Update status to let user know excluded sites were saved.
var status = document.getElementById('status');
status.textContent = 'Excluded sites saved.';
});
}
// Sort json by key in textarea
function sort_options() {
var textareaEl = document.querySelector('#excluded_sites textarea');
var sites_excluded = [];
if (textareaEl.value !== '') {
var sites_excluded = textareaEl.value.split(',').map(x => x.trim().replace('www.', ''));
var sites_excluded_sorted = sites_excluded.sort();
textareaEl.value = sites_excluded_sorted.join();
}
// Update status to let user know excluded sites were sorted.
var status = document.getElementById('status');
status.textContent = 'Excluded sites sorted (not saved yet)';
}
function renderOptions() {
ext_api.storage.local.get({
sites_excluded: []
}, function (items) {
var sites_excluded = items.sites_excluded;
var sitesEl = document.getElementById('excluded_sites');
sitesEl.innerHTML = '';
var labelEl = document.createElement('label');
var textareaEl = document.createElement('textarea');
textareaEl.placeholder = 'example1.com,example2.com';
textareaEl.value = sites_excluded.join();
textareaEl.rows = 12;
textareaEl.cols = 40;
labelEl.appendChild(textareaEl);
sitesEl.appendChild(labelEl);
});
}
document.addEventListener('DOMContentLoaded', renderOptions);
document.getElementById('save').addEventListener('click', save_options);
document.getElementById('sort').addEventListener('click', sort_options);

33
options/popup.html Normal file
View file

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="options_all.css"/>
<link rel="stylesheet" href="popup_switch.css"/>
<style>
body {
text-align: center;
}
div {
margin: 10px;
}
</style>
</head>
<body style="width:290px">
<div><strong>Bypass Paywalls Clean <span id="version"></span></strong><span id="site_switch_span">&nbsp;&nbsp;</span></div>
<div><a href="options.html" target="_blank">Options</a> |
<a href="options_custom.html" target="_blank">Custom</a> |
<a href="/README.html" target="_blank">Help</a> |
<a href="https://x.com/Magnolia1234B" target="_blank">X</a> |
<a href="https://xcancel.com/Magnolia1234B" target="_blank">Nitter</a></div>
<div><a href="https://gitflic.ru/project/magnolia1234/bypass-paywalls-chrome-clean/blob/raw?file=changelog.txt" target="_blank">Changelog</a> |
<button id="clear_cookies" title="clear cookies (and local storage) for current site">clear cookies<br>(& permission)</button> |
<button id="button-close" title="close popup">close</button></div>
<div><span id="version_new"></span></div>
<div><span>* for unlisted sites: first clear cookies (X = no fix) & block general paywall-scripts (in options) or use custom sites/reader view</span></div>
<div><span id="archive"></span></div>
<script id="popup" src="version.js"></script>
<script src="popup.js"></script>
</body>
</html>

170
options/popup.js Normal file
View file

@ -0,0 +1,170 @@
var ext_api = (typeof browser === 'object') ? browser : chrome;
var url_loc = (typeof browser === 'object') ? 'firefox' : 'chrome';
var manifestData = ext_api.runtime.getManifest();
var ext_manifest_version = manifestData.manifest_version;
var navigator_ua = navigator.userAgent;
var navigator_ua_mobile = navigator_ua.toLowerCase().includes('mobile');
var chrome_android_browser = navigator_ua_mobile && (url_loc === 'chrome') && !navigator_ua.toLowerCase().includes('yabrowser');
var custom_switch = ((manifestData.optional_permissions && manifestData.optional_permissions.length) || (manifestData.optional_host_permissions && manifestData.optional_host_permissions.length)) && !chrome_android_browser;
// htmlviewer: clean layout
ext_api.tabs.query({
active: true,
currentWindow: true
}, function (tabs) {
if (tabs && tabs[0] && ((tabs[0].url === 'about:blank' && tabs[0].title !== 'about:blank') || tabs[0].url === 'https://codebeautify.org/htmlviewer')) {
let tabId = tabs[0].id;
if (ext_manifest_version === 2) {
ext_api.tabs.executeScript(tabId, {
file: '/options/htmlviewer.js'
}, function (res) {
if (ext_api.runtime.lastError || res[0]) {
return;
}
});
} else if (ext_manifest_version === 3) {
ext_api.scripting.executeScript({
target: {tabId: tabId},
files: ["/options/htmlviewer.js"]
})
}
}
});
function popup_show_toggle(domain, enabled) {
if (domain) {
var site_switch_span = document.getElementById('site_switch_span');
let labelEl = document.createElement('label');
labelEl.setAttribute('class', 'switch');
let inputEl = document.createElement('input');
inputEl.setAttribute('id', 'site_switch');
inputEl.setAttribute('type', 'checkbox');
if (enabled)
inputEl.setAttribute('checked', true);
labelEl.appendChild(inputEl);
let spanEl = document.createElement('span');
spanEl.setAttribute('class', 'slider round');
spanEl.setAttribute('title', 'en/disable current site/group in BPC');
labelEl.appendChild(spanEl);
site_switch_span.appendChild(labelEl);
document.getElementById("site_switch").addEventListener('click', function () {
ext_api.runtime.sendMessage({
request: 'site_switch'
});
//open(location).close();
});
}
};
ext_api.runtime.sendMessage({
request: 'popup_show_toggle'
});
ext_api.runtime.onMessage.addListener(function (message, sender) {
if (message.msg === 'popup_show_toggle' && message.data) {
popup_show_toggle(message.data.domain, message.data.enabled)
}
});
var cookie_domain;
ext_api.tabs.query({
active: true,
currentWindow: true
}, function (tabs) {
if (tabs && tabs[0] && /^http/.test(tabs[0].url)) {
let hostname = new URL(tabs[0].url).hostname;
cookie_domain = getCookiePermDomain(hostname);
}
});
document.getElementById("clear_cookies").addEventListener('click', function () {
if (custom_switch)
ext_api.permissions.request({
origins: ["*://*." + cookie_domain + "/*"]
}, function (granted) {
if (granted) {
ext_api.runtime.sendMessage({
request: 'clear_cookies'
});
}
});
else
ext_api.permissions.contains({
origins: ["*://*." + cookie_domain + "/*"]
}, function (result) {
if (result) {
ext_api.runtime.sendMessage({
request: 'clear_cookies'
});
}
});
});
function showArchiveLinks() {
ext_api.tabs.query({
active: true,
currentWindow: true
}, function (tabs) {
if (tabs && tabs[0] && /^http/.test(tabs[0].url)) {
let url = tabs[0].url;
let hostname = urlHost(url);
let url_enc = encodeURIComponent(url);
let archive_array = {
'Archive.today': 'https://archive.today?run=1&url=' + url_enc,
'Clearthis.page': 'https://clearthis.page?u=' + url_enc,
'Google Search Tool\n(see help - troubleshooting)': 'https://search.google.com/test/rich-results?url=' + url_enc
};
let archive_id = document.querySelector('span#archive');
if (archive_id) {
archive_id.appendChild(document.createTextNode('Open tab in:'));
for (let key in archive_array) {
let elem_div = document.createElement('div');
let elem = document.createElement('a');
elem.innerText = key;
if (!(matchDomain(['clearthis.page', 'google.com'], hostname) || hostname.match(/^archive\.\w{2}$/))) {
elem.href = archive_array[key];
elem.title = elem.href;
elem.target = '_blank';
elem_div.appendChild(elem);
archive_id.appendChild(elem_div);
}
}
}
}
});
}
showArchiveLinks();
function matchDomain(domains, hostname = window.location.hostname) {
let matched_domain = false;
if (typeof domains === 'string')
domains = [domains];
domains.some(domain => (hostname === domain || hostname.endsWith('.' + domain)) && (matched_domain = domain));
return matched_domain;
}
function urlHost(url) {
if (/^http/.test(url)) {
try {
return new URL(url).hostname;
} catch (e) {
console.log(`url not valid: ${url} error: ${e}`);
}
}
return url;
}
function closeButton() {
window.close();
}
function getCookiePermDomain(hostname) {
let domain = hostname.replace(/^(www|amp(html)?|m|wap)(\d)?\./, '');
let domain_split = domain.split('.');
let num = 2;
if (domain_split.length > 2 && domain.match(/(\w){2,4}\.(\w){2}$/))
num = 3;
domain = domain_split.slice(-num).join('.');
return domain;
}
document.getElementById("button-close").addEventListener('click', closeButton);

58
options/popup_switch.css Normal file
View file

@ -0,0 +1,58 @@
.switch {
position: relative;
display: inline-block;
width: 30px;
height: 17px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: blue;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 13px;
width: 13px;
left: 2px;
bottom: 2px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked + .slider {
background-color: red;
}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked + .slider:before {
-webkit-transform: translateX(13px);
-ms-transform: translateX(13px);
transform: translateX(13px);
}
.slider.round {
border-radius: 9px;
}
.slider.round:before {
border-radius: 50%;
}

5
options/toggleIcon.js Normal file
View file

@ -0,0 +1,5 @@
// message for dark or incognito mode (chrome)
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches || chrome.extension.inIncognitoContext)
chrome.runtime.sendMessage({scheme: 'dark'});
else
chrome.runtime.sendMessage({scheme: 'light'});

79
options/version.js Normal file
View file

@ -0,0 +1,79 @@
var ext_api = (typeof browser === 'object') ? browser : chrome;
var manifestData = ext_api.runtime.getManifest();
var url_loc = manifestData.key ? 'chrome' : 'firefox';
var ext_url = 'https://gitflic.ru/project/magnolia1234/bpc_uploads';
var ext_name = manifestData.name;
var version_str = 'v' + manifestData.version;
var version_span = document.querySelector('span#version');
if (version_span)
version_span.innerText = version_str;
var version_span_new = document.querySelector('span#version_new');
version_span_new.setAttribute('style', 'font-weight: bold;');
var anchorEl;
function show_warning() {
let warning;
if (!ext_name.includes('Clean')) {
warning = 'fake';
}
if (warning) {
let par = document.createElement('p');
let ext_link = document.createElement('a');
ext_link.href = ext_url;
ext_link.innerText = "You've installed a " + warning + " version of Bypass Paywalls Clean";
ext_link.target = '_blank';
par.style = 'font-weight: bold;';
par.appendChild(ext_link);
version_span_new.appendChild(par);
}
}
function show_update(ext_version_new, check = true) {
if (ext_version_new) {
ext_api.management.getSelf(function (result) {
var installType = result.installType;
var version_len = (installType === 'development') ? 7 : 5;
if (ext_version_new.substring(0, version_len) > manifestData.version.substring(0, version_len)) {
ext_api.storage.local.set({
ext_version_new: ext_version_new
});
anchorEl = document.createElement('a');
anchorEl.target = '_blank';
if (installType === 'development')
anchorEl.href = ext_url;
else {
anchorEl.href = ext_url;
ext_version_new = ext_version_new.replace(/\d$/, '0');
}
anchorEl.innerText = 'New release v' + ext_version_new;
version_span_new.appendChild(anchorEl);
}
});
show_warning();
} else if (check) {
anchorEl = document.createElement('a');
anchorEl.text = 'Check X/Twitter for latest update';
anchorEl.href = 'https://x.com/Magnolia1234B';
anchorEl.target = '_blank';
version_span_new.appendChild(anchorEl);
}
}
function check_version_update(ext_version_new, popup) {
if (!popup) {
ext_api.runtime.sendMessage({
request: 'check_update'
});
show_update(ext_version_new);
} else
show_update(ext_version_new, false);
}
ext_api.storage.local.get({optInUpdate: true, ext_version_new: false}, function (result) {
if (result.optInUpdate) {
let popup = document.querySelector('script[id="popup"]');
check_version_update(result.ext_version_new, popup);
} else
show_warning();
});

3528
sites.js Normal file

File diff suppressed because it is too large Load diff

74
sites_updated.json Normal file
View file

@ -0,0 +1,74 @@
{
"Bonnier News Group": {
"domain": "###_se_bonnier_group",
"group": [
"dagensmedicin.se",
"dn.se",
"hd.se",
"sydsvenskan.se"
],
"allow_cookies": 1,
"useragent": "googlebot",
"exception": [{
"domain": "dn.se",
"allow_cookies": 1,
"ld_archive_is": "div.paywall-wrapper|article"
}
],
"upd_version": "4.0.8.5"
},
"Dagens ETC": {
"domain": "etc.se",
"allow_cookies": 1,
"cs_code": "[{\"cond\":\"section.teaser-section\", \"rm_class\":\"teaser-section\"}, {\"cond\":\"section.prose-feature .hidden\", \"rm_class\":\"hidden\"}]",
"upd_version": "4.0.8.6"
},
"Frankfurter Rundschau": {
"domain": "fr.de",
"allow_cookies": 1,
"block_regex": "\\.fr\\.de\\/sub\\/js\\/pc-offer-west\\.js",
"upd_version": "4.0.7.4"
},
"MilanoFinanza.it": {
"domain": "milanofinanza.it",
"allow_cookies": 1,
"ld_json": "div.paywall-content,section.payment|div.article-locked",
"upd_version": "4.0.8.1"
},
"NOZ/MHN Mediengruppe": {
"domain": "###_de_noz_mhn",
"group": [
"noz.de",
"shz.de"
],
"allow_cookies": 1,
"ld_archive_is": "div.paywall|article",
"upd_version": "4.0.8.4"
},
"Pirate Wires": {
"allow_cookies": 1,
"domain": "piratewires.com",
"block_regex": "\\.piratewires\\.com\\/_next\\/static\\/chunks\\/1164-.+\\.js",
"useragent_custom": "Mozilla/5.0 (compatible; Twitterbot/1.0)",
"upd_version": "4.0.8.7"
},
"Repubblica.it": {
"domain": "repubblica.it",
"allow_cookies": 1,
"block_regex": "\\.ampproject\\.org\\/v0\\/amp-subscriptions-.+\\.js",
"amp_redirect": "iframe[id^='__limio_frame']|{path}amp/",
"upd_version": "4.0.8.7"
},
"The Scottish Sun": {
"domain": "thescottishsun.co.uk",
"allow_cookies": 1,
"block_regex": "\\.thescottishsun\\.co\\.uk\\/zephr\\/feature",
"upd_version": "4.0.7.3"
},
"Vice": {
"domain": "vice.com",
"allow_cookies": 1,
"cs_code": "[{\"cond\":\"iframe.swg-dialog,swg-popup-background\", \"rm_elem\":1}, {\"cond\":\"body.swg-disable-scroll\", \"rm_class\":\"swg-disable-scroll\"}]",
"upd_version": "4.0.8.6"
}
}

6
updates.xml Normal file
View file

@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lkbebcjgcmobigpeffafkodonchffocl'>
<updatecheck codebase='https://gitflic.ru/project/magnolia1234/bpc_uploads/blob/raw?file=bypass-paywalls-chrome-clean-4.0.8.0.crx' version='4.0.8.0' />
</app>
</gupdate>