mirror of
https://github.com/bytedream/stream-bypass.git
synced 2025-05-11 13:15:13 +02:00
Make video replace strategy more aggressive
This commit is contained in:
parent
94eee79218
commit
6286acf85c
@ -41,13 +41,28 @@ async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (match.replace && !url.includes('.m3u8')) {
|
if (match.replace && !url.includes('.m3u8')) {
|
||||||
|
// this destroys all intervals that may spawn popups or events
|
||||||
|
let intervalId = window.setInterval(() => {}, 0);
|
||||||
|
while (intervalId--) {
|
||||||
|
clearInterval(intervalId);
|
||||||
|
}
|
||||||
|
let timeoutId = window.setTimeout(() => {}, 0);
|
||||||
|
while (timeoutId--) {
|
||||||
|
clearTimeout(timeoutId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// clear completed document
|
||||||
|
document.documentElement.innerHTML = '';
|
||||||
|
|
||||||
|
// video player
|
||||||
const player = document.createElement('video');
|
const player = document.createElement('video');
|
||||||
player.style.width = '100%';
|
player.style.width = '100%';
|
||||||
player.style.height = '100%';
|
player.style.height = '100%';
|
||||||
player.controls = true;
|
player.controls = true;
|
||||||
player.src = url;
|
player.src = url;
|
||||||
|
|
||||||
document.body.innerHTML = '';
|
// add video player to document body
|
||||||
|
document.body.style.margin = '0';
|
||||||
document.body.append(player);
|
document.body.append(player);
|
||||||
} else {
|
} else {
|
||||||
window.location.assign(
|
window.location.assign(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user