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/options/clearCookies.js

23 lines
776 B
JavaScript

var ext_api = (typeof browser === 'object') ? browser : chrome;
window.localStorage.clear();
sessionStorage.clear();
// send domain to background.js (to clear cookies)
ext_api.runtime.sendMessage({
domain: document.domain
});
let msg = "Cookies (and local storage) removed from " + document.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);
}