fchat-rising/chat/preview/assets/browser.pre.js

75 lines
2.1 KiB
JavaScript
Raw Normal View History

2020-03-15 18:17:36 +00:00
(() => {
try {
2020-03-30 21:52:25 +00:00
const clear = () => {
2020-04-01 22:19:55 +00:00
if (window.location.href.match(/^https?:\/\/(www.)?pornhub.com/)) {
2020-03-30 21:52:25 +00:00
if (!window.zest) {
window.zest = (q) => (document.querySelectorAll(q));
}
return;
}
try {
const frameCount = window.frames.length;
for (let i = 0; i < frameCount; i++) {
window.frames[i].location = 'about:blank';
}
} catch (e) {
console.error('Frame location', e);
}
try {
const scriptCount = document.scripts.length;
for (let i = 0; i < scriptCount; i++) {
document.scripts[i].src = 'about:blank';
}
} catch (e) {
console.error('Script location', e);
}
try {
document.querySelectorAll('iframe, script' /*, style, head' */ )
.forEach((e) => e.remove());
} catch (e) {
console.error('Element remove', e);
}
2020-04-01 22:19:55 +00:00
// const intervalCount = setInterval(() => {}, 10000);
//
// for (let i = 0; i <= intervalCount; i++) {
// try {
// clearInterval(i);
// } catch (e) {
// console.error('Clear interval', i, e);
// }
// }
//
//
// const timeoutCount = setTimeout(() => {}, 10000);
//
// for (let i = 0; i <= timeoutCount; i++) {
// try {
// clearTimeout(i);
// } catch (e) {
// console.error('Clear timeout', i, e);
// }
// }
2020-03-30 21:52:25 +00:00
};
console.log('Document loading', Date.now());
clear();
2020-03-15 18:17:36 +00:00
window.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM fully loaded and parsed', Date.now());
2020-03-30 21:52:25 +00:00
clear();
2020-03-15 18:17:36 +00:00
});
} catch(e) {
2020-04-01 22:19:55 +00:00
console.error('browser.pre', e);
console.trace();
2020-03-15 18:17:36 +00:00
}
})();