Update script.js

This commit is contained in:
Alperen Çetin 2022-06-16 17:29:41 +03:00 committed by Victor Westerlund
parent 4f822b2a69
commit f3f8fe9ff4

View file

@ -18,9 +18,9 @@ class PIPController {
// Returns true if the page is /video/
isPlayerPage() {
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