mirror of
https://codeberg.org/vlw/disneyplus-pip.git
synced 2025-09-14 02:33:41 +02:00
Update script.js
This commit is contained in:
parent
4f822b2a69
commit
f3f8fe9ff4
1 changed files with 3 additions and 3 deletions
|
@ -18,9 +18,9 @@ class PIPController {
|
||||||
// Returns true if the page is /video/
|
// Returns true if the page is /video/
|
||||||
isPlayerPage() {
|
isPlayerPage() {
|
||||||
const url = new URL(window.location);
|
const url = new URL(window.location);
|
||||||
const pathname = url.pathname.split("/");
|
const pattern = /^\/?([A-Za-z-]*)?\/video\//i;
|
||||||
|
|
||||||
return pathname[1] === "video" ? true : false;
|
return pattern.test(url.pathname) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enter/exit PIP mode
|
// Enter/exit PIP mode
|
||||||
|
@ -77,4 +77,4 @@ class PIPController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener("load", () => new PIPController(), { once: true });
|
window.addEventListener("load", () => new PIPController(), { once: true });
|
||||||
|
|
Loading…
Add table
Reference in a new issue