Fix-update NY Times (incognito mode)

master
magnolia1234 2020-07-15 18:45:17 +02:00
parent c790a2dde0
commit 70d6ccc663
1 changed files with 16 additions and 1 deletions

View File

@ -235,7 +235,12 @@ else if (matchDomain("thehindu.com")) {
}
else if (matchDomain("nytimes.com")) {
const preview_button = document.querySelector('.css-3s1ce0');
function nyt_main() {
navigator.storage.estimate = undefined;
webkitRequestFileSystem = function () {};
}
insert_script(nyt_main);
let preview_button = document.querySelector('.css-3s1ce0');
if (preview_button)
preview_button.click();
}
@ -885,6 +890,16 @@ function setCookie(name, value, domain, path, days) {
document.cookie = name + "=" + (value || "") + "; domain=" + domain + "; path=" + path + "; max-age=" + max_age;
}
function insert_script(func) {
let bpc_script = document.querySelector('script#bpc_script');
if (!bpc_script) {
let script = document.createElement('script');
script.setAttribute('id', 'bpc_script');
script.appendChild(document.createTextNode('(' + func + ')();'));
(document.body || document.head || document.documentElement).appendChild(script);
}
}
function genHexString(len) {
let output = '';
for (let i = 0; i < len; i++) {