init
This commit is contained in:
commit
87707583a3
6 changed files with 159 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/web-ext-artifacts
|
||||
3
README.md
Normal file
3
README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Disney+ auto fullscreen
|
||||
|
||||
Automatically enter fullscreen when watching videos on Disney+.
|
||||
BIN
icons/icon-48.png
Normal file
BIN
icons/icon-48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 901 B |
66
icons/icon-48.svg
Normal file
66
icons/icon-48.svg
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="48"
|
||||
height="48"
|
||||
viewBox="0 0 12.7 12.7"
|
||||
version="1.1"
|
||||
id="svg1"
|
||||
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
|
||||
inkscape:export-filename="image.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
sodipodi:docname="icon-48.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview1"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#ffffff"
|
||||
inkscape:document-units="px"
|
||||
showgrid="false"
|
||||
inkscape:zoom="8.8717609"
|
||||
inkscape:cx="29.137395"
|
||||
inkscape:cy="25.361369"
|
||||
inkscape:window-width="1898"
|
||||
inkscape:window-height="1019"
|
||||
inkscape:window-x="10"
|
||||
inkscape:window-y="28"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1" />
|
||||
<defs
|
||||
id="defs1" />
|
||||
<g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<rect
|
||||
style="color:#000000;overflow:visible;fill:#216778;stroke:none;stroke-width:5.01369;stroke-linecap:round;stroke-linejoin:round;paint-order:stroke markers fill;stop-color:#000000"
|
||||
id="rect108"
|
||||
width="12.7"
|
||||
height="12.7"
|
||||
x="4.3869019e-08"
|
||||
y="9.5367433e-08"
|
||||
rx="5.0580163"
|
||||
ry="0" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.66028px;line-height:125%;font-family:Tahoma;-inkscape-font-specification:'Tahoma, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#dbe3de;fill-opacity:1;stroke:none;stroke-width:0.452832px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
x="1.4763886"
|
||||
y="9.3446865"
|
||||
id="text997"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan995"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono';fill:#dbe3de;stroke-width:0.452832px"
|
||||
x="1.4763886"
|
||||
y="9.3446865">D+</tspan></text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
29
manifest.json
Normal file
29
manifest.json
Normal file
|
|
@ -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"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
60
src/play.js
Normal file
60
src/play.js
Normal file
|
|
@ -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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue