2020-09-08 16:38:18 +02:00
|
|
|
"use strict";
|
|
|
|
var ext_api = chrome || browser;
|
|
|
|
|
|
|
|
window.addEventListener("load", function () {
|
2020-09-22 21:06:28 +02:00
|
|
|
var opt_in_enabled = document.getElementById('opt-in-enabled');
|
2020-09-08 16:38:18 +02:00
|
|
|
ext_api.storage.sync.get("optIn", function (result) {
|
2020-09-22 21:06:28 +02:00
|
|
|
opt_in_enabled.innerText = result.optIn ? 'YES' : 'NO';
|
2020-09-08 16:38:18 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
document.getElementById("button-enable").addEventListener(
|
|
|
|
"click",
|
|
|
|
function () {
|
|
|
|
ext_api.storage.sync.set({
|
|
|
|
"optIn": true,
|
|
|
|
"optInShown": true
|
|
|
|
});
|
2020-09-22 21:06:28 +02:00
|
|
|
opt_in_enabled.innerText = 'YES';
|
|
|
|
setTimeout(function () {
|
|
|
|
window.close();
|
|
|
|
}, 800);
|
2020-09-08 16:38:18 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
document.getElementById("button-cancel").addEventListener(
|
|
|
|
"click",
|
|
|
|
function () {
|
|
|
|
ext_api.storage.sync.set({
|
|
|
|
"optIn": false,
|
|
|
|
"optInShown": true
|
|
|
|
});
|
2020-09-22 21:06:28 +02:00
|
|
|
opt_in_enabled.innerText = 'NO';
|
|
|
|
setTimeout(function () {
|
|
|
|
window.close();
|
|
|
|
}, 800);
|
2020-09-08 16:38:18 +02:00
|
|
|
});
|
|
|
|
});
|