You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bypass-paywalls-firefox-clean/optin/opt-in.js

35 lines
967 B
JavaScript

"use strict";
var ext_api = chrome || browser;
window.addEventListener("load", function () {
var opt_in_enabled = document.getElementById('opt-in-enabled');
ext_api.storage.sync.get("optIn", function (result) {
opt_in_enabled.innerText = result.optIn ? 'YES' : 'NO';
});
document.getElementById("button-enable").addEventListener(
"click",
function () {
ext_api.storage.sync.set({
"optIn": true,
"optInShown": true
});
opt_in_enabled.innerText = 'YES';
setTimeout(function () {
window.close();
}, 800);
});
document.getElementById("button-cancel").addEventListener(
"click",
function () {
ext_api.storage.sync.set({
"optIn": false,
"optInShown": true
});
opt_in_enabled.innerText = 'NO';
setTimeout(function () {
window.close();
}, 800);
});
});