commit 87707583a34d1984df3a6733f8cd7f87ea93200c Author: Simon Vieille Date: Fri Jan 16 23:54:58 2026 +0100 init 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 0000000..03ce7d8 Binary files /dev/null and b/icons/icon-48.png differ diff --git a/icons/icon-48.svg b/icons/icon-48.svg new file mode 100644 index 0000000..35cc39f --- /dev/null +++ b/icons/icon-48.svg @@ -0,0 +1,66 @@ + + + + + + + + + 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)