Upgrade to the latest version.

This commit is contained in:
2026-01-04 21:30:53 +01:00
parent e4d67b962a
commit 733097a002
33 changed files with 6239 additions and 9055 deletions

View File

@@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bypass Paywalls Clean (setCookie, custom sites & check update opt-in)</title>
<title>Bypass Paywalls Clean (opt-in)</title>
<link rel="stylesheet" href="../options_all.css"/>
<link rel="stylesheet" href="opt-in.css"/>
<script src="opt-in.js"></script>
@@ -12,7 +12,38 @@
<body>
<div>
<p><strong>Bypass Paywalls Clean<br> - setCookie, custom sites & check update opt-in</strong></p>
<p><strong>Bypass Paywalls Clean<br>Opt-in options for additonal functionality/consent.</strong></p>
</div>
</div>
<div id="custom-prompt">
<p><strong>custom sites opt-in</strong></p>
<p>If you want to enable <a href="../options_custom.html">custom sites</a> (for new 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>
</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="fetch-prompt">
<p><strong>fetch consent opt-in</strong></p>
For some sites (see options) the full article content is fetched from an external site (like archive.is).</br>
This requires a 'data transmission' (no data collection by add-on) of the article-url to this external site.</br>
If you disable 'fetch consent' (default setting) this add-on will not work for these sites.</br>
</p>
<p>Fetch enabled: <span id="fetch-enabled"></span></p>
<div id="fetch-container">
<button id="fetch-enable">Enable</button>
<button id="fetch-disable">Disable</button>
</div>
</div>
<div id="opt-in-prompt">
@@ -23,34 +54,6 @@
<div id="optin-container">
<button id="optin-enable">Enable</button>
<button id="optin-disable">Disable</button>
</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>
</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="counter-prompt">
<p><strong>daily users counter opt-in</strong></p>
<p>Very basic daily users counter (by counting the download of an empty json-file (no personal information is shared)):</br>
<p>daily users counter enabled: <span id="counter-enabled"></span></p>
<div id="custom-container">
<button id="counter-enable">Enable</button>
<button id="counter-disable">Disable</button>
</div>
</div>
<p>
<div style='float:left;padding-bottom:50px'>

View File

@@ -1,16 +1,18 @@
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 yandex_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)) && !(navigator_ua_mobile && (url_loc === 'chrome') && !yandex_browser);
var chrome_android_browser = navigator_ua_mobile && (url_loc === 'chrome');
var custom_switch = ((manifestData.optional_permissions && manifestData.optional_permissions.length) || (manifestData.optional_host_permissions && manifestData.optional_host_permissions.length));
window.addEventListener("load", function () {
document.getElementById("button-close").addEventListener("click", function () {
ext_api.storage.local.set({
"optInShown": true,
"customShown": true
"customShown": true,
"fetchShown": true
});
window.close();
});
@@ -19,6 +21,7 @@ window.addEventListener("load", function () {
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({
@@ -47,6 +50,13 @@ window.addEventListener("load", function () {
}
});
var custom_prompt = document.getElementById('custom-prompt');
if (chrome_android_browser) {
var android_span = document.createElement('span');
android_span.innerText = '* to enable the custom sites opt-in on Android you may need to use the android-custom crx-release.';
custom_prompt.appendChild(android_span);
}
if (custom_switch) {
document.querySelector('#custom-enable').addEventListener('click', function (event) {
@@ -58,6 +68,8 @@ window.addEventListener("load", function () {
ext_api.storage.local.set({
"customOptIn": true
});
if (ext_manifest_version === 3)
mv3_remove_perm_msg.innerText = '';
} else {
custom_enabled.innerText = 'NO';
}
@@ -69,13 +81,17 @@ window.addEventListener("load", function () {
document.querySelector('#custom-disable').addEventListener('click', function (event) {
ext_api.permissions.remove({
origins: ["*://*/*", "<all_urls>"]
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 = 'Extension will be reloaded to apply changes in optional host permissions.';
ext_api.runtime.reload();
}
}
ext_api.storage.local.set({
"customShown": true
@@ -104,22 +120,33 @@ window.addEventListener("load", function () {
update_enabled.innerText = 'NO';
});
var counter_enabled = document.getElementById('counter-enabled');
ext_api.storage.local.get({counter: true}, function (result) {
counter_enabled.innerText = result.counter ? 'YES' : 'NO';
if (typeof browser === 'object') { // fetch consent (Firefox only)
var fetch_enabled = document.getElementById('fetch-enabled');
ext_api.storage.local.get("optInFetch", function (result) {
fetch_enabled.innerText = result.optInFetch ? 'YES' : 'NO';
});
document.getElementById("counter-enable").addEventListener("click", function () {
document.getElementById("fetch-enable").addEventListener("click", function () {
ext_api.storage.local.set({
"counter": true
"optInFetch": true,
"fetchShown": true
});
counter_enabled.innerText = 'YES';
fetch_enabled.innerText = 'YES';
});
document.getElementById("counter-disable").addEventListener("click", function () {
document.getElementById("fetch-disable").addEventListener("click", function () {
ext_api.storage.local.set({
"counter": false
"optInFetch": false,
"fetchShown": true
});
counter_enabled.innerText = 'NO';
fetch_enabled.innerText = 'NO';
});
} else {
let fetch_prompt = document.querySelector('div#fetch-prompt');
if (fetch_prompt)
fetch_prompt.style = 'display: none';
}
});