Add opt-in for setCookie (for specific sites)
parent
3b8d91eba9
commit
d8a00f1f1c
@ -0,0 +1,9 @@
|
|||||||
|
html, body {
|
||||||
|
width: 20em;
|
||||||
|
padding-left: 0.5em;
|
||||||
|
padding-right: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin: 0.2em 0.2em 0.5em 0;
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Bypass Paywalls Clean (setCookie opt-in)</title>
|
||||||
|
<link rel="stylesheet" href="opt-in.css"/>
|
||||||
|
<script src="opt-in.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="opt-in-prompt">
|
||||||
|
<p><strong>Bypass Paywalls Clean (setCookie opt-in)</strong></p>
|
||||||
|
<p>For some sites (check list in options) a necessary cookie has to be set (this cookie doesn't contain any personal information about the user or device):</br></br>
|
||||||
|
Australian Provincial Newspapers</br>
|
||||||
|
Boston Globe</br>
|
||||||
|
Irish Independent</br>
|
||||||
|
The Belfast Telegraph</p>
|
||||||
|
<p><span id="opt-in-enabled"></span></p>
|
||||||
|
<div id="button-container">
|
||||||
|
<button id="button-enable">Enable</button>
|
||||||
|
<button id="button-cancel" autofocus="true">Disable</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="after-opt-in" hidden="true">
|
||||||
|
<p>Do something else.</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -0,0 +1,38 @@
|
|||||||
|
"use strict";
|
||||||
|
var ext_api = chrome || browser;
|
||||||
|
|
||||||
|
window.addEventListener("load", function () {
|
||||||
|
ext_api.storage.sync.get("optIn", function (result) {
|
||||||
|
var opt_in_enabled = document.getElementById('opt-in-enabled');
|
||||||
|
opt_in_enabled.appendChild(document.createTextNode('SetCookie opt-in enabled: ' + (result.optIn ? 'YES' : 'NO')));
|
||||||
|
//console.log("Setting up UI. result.optIn:" + result.optIn);
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("button-enable").addEventListener(
|
||||||
|
"click",
|
||||||
|
function () {
|
||||||
|
ext_api.storage.sync.set({
|
||||||
|
"optIn": true,
|
||||||
|
"optInShown": true
|
||||||
|
});
|
||||||
|
window.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById("button-cancel").addEventListener(
|
||||||
|
"click",
|
||||||
|
function () {
|
||||||
|
ext_api.storage.sync.set({
|
||||||
|
"optIn": false,
|
||||||
|
"optInShown": true
|
||||||
|
});
|
||||||
|
window.close();
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
// set up the appearance of the popup depending on the outcome of the opt-in
|
||||||
|
ext_api.storage.sync.get("optInShown", function (result) {
|
||||||
|
console.log("Setting up UI. result.optInShown:" + result.optInShown);
|
||||||
|
document.getElementById("opt-in-prompt").hidden = result.optInShown;
|
||||||
|
document.getElementById("after-opt-in").hidden = !result.optInShown;
|
||||||
|
});
|
||||||
|
**/
|
||||||
|
});
|
Loading…
Reference in New Issue