From 87707583a34d1984df3a6733f8cd7f87ea93200c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 16 Jan 2026 23:54:58 +0100 Subject: [PATCH] init --- .gitignore | 1 + README.md | 3 +++ icons/icon-48.png | Bin 0 -> 901 bytes icons/icon-48.svg | 66 ++++++++++++++++++++++++++++++++++++++++++++++ manifest.json | 29 ++++++++++++++++++++ src/play.js | 60 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 159 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 icons/icon-48.png create mode 100644 icons/icon-48.svg create mode 100644 manifest.json create mode 100644 src/play.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bde2dfc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/web-ext-artifacts diff --git a/README.md b/README.md new file mode 100644 index 0000000..9ed39c1 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Disney+ auto fullscreen + +Automatically enter fullscreen when watching videos on Disney+. diff --git a/icons/icon-48.png b/icons/icon-48.png new file mode 100644 index 0000000000000000000000000000000000000000..03ce7d8e09883d0f616c87c15244b1d64bdc781a GIT binary patch literal 901 zcmV;01A6?4P)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10}@F@ zK~!jg?U_qY6Hye$|1Ho?OCO^=bm0PTLD3$^2Gl=FU0y{Bz%TWbCz@ zTiD0Q#ZI75BmrV02@o4efY?X^#6}VzHpSUKsMKp=H5y>hs-a<&0DveLM{q5I$)#m% z#FM+8Bp$Yv8ojK&N8zs-Ma5G(hQvu!3$X-I4mZ#TFu+u*H@Gg`@EwO zEtcwS-;B&I;)6e!F*a2J|IYs*jw5!nxe8a?9lXA0nj3a}ABu6j0;qN&gGNp4Xe>@M zbVjJPfQC`PsM7%WwM+GX50SE7_c(gp + + + + + + + + D+ + + diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..a8b359f --- /dev/null +++ b/manifest.json @@ -0,0 +1,29 @@ +{ + "content_scripts": [ + { + "matches": ["*://www.disneyplus.com/*/play/*"], + "js": ["src/play.js"] + } + ], + "browser_action": { + "default_title": "Favourite colour option" + }, + "description": "Automatically enter fullscreen when watching videos on Disney+.", + "homepage_url": "https://gitnet.fr/deblan/firefoxext-disneyplus-auto-fullscreen", + "manifest_version": 2, + "name": "Disney+ auto fullscreen", + "permissions": [ + "storage", + "scripting" + ], + "version": "1.1", + "browser_specific_settings": { + "gecko": { + "id": "firefoxext-disneyplus-auto-fullscreen@deblan.fr", + "strict_min_version": "140.0", + "data_collection_permissions": { + "required": ["websiteContent", "storage"] + } + } + } +} diff --git a/src/play.js b/src/play.js new file mode 100644 index 0000000..ec78547 --- /dev/null +++ b/src/play.js @@ -0,0 +1,60 @@ +const body = document.querySelector('body') + +let intervalSkip +let intervalFullscreen + +const handleFullscreen = () => { + const component = document.querySelector('.toggle-fullscreen-button') + + if (!component) { + return + } + + const button = component.shadowRoot.querySelector('.fullscreen-icon') + + if (!button) { + return + } + + const event = new KeyboardEvent('keydown', { + key: 'Enter', + code: 'Enter', + keyCode: 13, + charCode: 13, + bubbles: true, + cancelable: true + }) + + // const video = document.querySelector('disney-web-player video') + // const playerUi = document.querySelector('disney-web-player-ui') + + // video.focus() + // video.click() + + body.mozRequestFullScreen(); + + // button.parentNode.click() + // button.click() +} + +const handleSkip = () => { + const component = document.querySelector('disney-web-player-ui') + + if (!component) { + return + } + + const button = component.querySelector('.skip__button') + const overlay = component.shadowRoot.querySelector('.overlay__skip') + + if (!button) { + return + } + + clearInterval(intervalSkip) + + button.click() +} + +intervalFullscreen = setInterval(handleFullscreen, 3000) +intervalSkip = setInterval(handleSkip, 500)