mirror of
https://codeberg.org/vlw/disneyplus-pip.git
synced 2025-09-14 02:33:41 +02:00
Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
6328655a56 | |||
![]() |
8e59f7a414 | ||
![]() |
f3f8fe9ff4 | ||
![]() |
4f822b2a69 |
4 changed files with 15 additions and 8 deletions
10
README.md
10
README.md
|
@ -1,3 +1,6 @@
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> **This extension is deprecated and no longer maintained.** ([#6](https://github.com/VictorWesterlund/disneyplus-pip/issues/6)) Feel free to fork the code and make any changes you want!
|
||||||
|
|
||||||
## Picture in Picture for Disney+
|
## Picture in Picture for Disney+
|
||||||
|
|
||||||

|

|
||||||
|
@ -6,7 +9,7 @@ Add Picture-in-Picture support on Disney+ in the browser.
|
||||||
|
|
||||||
## Install from the Chrome Web Store
|
## Install from the Chrome Web Store
|
||||||
|
|
||||||
[**Install from the Chrome Web Store**](https://chrome.google.com/webstore/detail/disney%20-pip/mjncaeojcjldpplapjioikobkgedockm)
|
[~**Install from the Chrome Web Store**~](https://chrome.google.com/webstore/detail/disney%20-pip/mjncaeojcjldpplapjioikobkgedockm) ⚠️ Deprecated
|
||||||
|
|
||||||
## Install Chrome Extension
|
## Install Chrome Extension
|
||||||
|
|
||||||
|
@ -23,10 +26,13 @@ Add Picture-in-Picture support on Disney+ in the browser.
|
||||||
|
|
||||||
## Install UserScript
|
## Install UserScript
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> **This userscript is deprecated and no longer maintained.** ([#6](https://github.com/VictorWesterlund/disneyplus-pip/issues/6)) Feel free to fork the code and make any changes you want!
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
You can also find an older UserScript of this on [GreasyFork](https://greasyfork.org/en/scripts/420964-disney-picture-in-picture). Please note that this version is no longer maintained so support is not guaranteed.
|
You can also find an older UserScript of this on [GreasyFork](https://greasyfork.org/en/scripts/420964-disney-picture-in-picture). Please note that this version is no longer maintained so support is not guaranteed.
|
||||||
|
|
||||||
It should work with extensions like Tampermonkey ([Chrome](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en), [Firefox](https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/)) and Greasemonkey ([Firefox](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/)).
|
It should work with extensions like Tampermonkey ([Chrome](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en), [Firefox](https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/)) and Greasemonkey ([Firefox](https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/)).
|
||||||
|
|
||||||
**[Install from GreasyFork](https://greasyfork.org/en/scripts/420964-disney-picture-in-picture)**
|
[~**Install from GreasyFork**~](https://greasyfork.org/en/scripts/420964-disney-picture-in-picture) ⚠️ Deprecated
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "Disney+ PIP",
|
"name": "Disney+ PIP",
|
||||||
"description": "Adds Picture-in-Picture (PIP) support for Disney+",
|
"description": "Adds Picture-in-Picture (PIP) support for Disney+",
|
||||||
"version": "1.2",
|
"version": "1.3",
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"content_scripts": [{
|
"content_scripts": [{
|
||||||
"matches": ["https://*.disneyplus.com/*"],
|
"matches": ["https://*.disneyplus.com/*"],
|
||||||
|
|
|
@ -58,7 +58,8 @@
|
||||||
// Poll document tree until video element is loaded
|
// Poll document tree until video element is loaded
|
||||||
const init = (mutations, observer) => {
|
const init = (mutations, observer) => {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
if(!window.location.href.includes("/video/")) {
|
const pattern = /^\/?([A-Za-z-]*)?\/video\//i;
|
||||||
|
if(!pattern.test(window.location.pathname)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if(document.getElementsByTagName("video")[0]) {
|
if(document.getElementsByTagName("video")[0]) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue