Age | Commit message (Collapse) | Author |
|
Turns out `classList` isn't an array, it's a `DOMTokenList`, and it
doesn't have an `includes()` method. Instead, use `contains()`.
`DOMTokenList` also doesn't have a `filter()`, but we can remove the
`.postplay` class much easier with the `remove()` method.
Turns out I didn't need to worry about a `childList` mutation observer
as I previously thought. This version works. Now that the class is
removed, the video no longer reduces to the small frame.
|
|
Use a `MutationObserver` to get an event when the Netflix player's class
attribute changes. Want to try removing the `.postplay` class, which
makes the player reduce to a small frame.
This doesn't currently work because when the player is reduced, a second
player element is added to the DOM, and my reference no longer
corresponds to the right player.
Looks like I'll need to try adding a mutation observer on child
elements, and watch for a new player element being added.
|
|
This doesn't work. It's not possible to modify the response body using
this API, and even if I could, it turns out the flags I intended to
modify aren't related to the small-window-credits.
|
|
I had obviously copied this manifest code from one of my other
extensions, and forgot to change the ID. Use a unique ID.
|
|
Back when I first tried writing this, I explored a couple ideas using
the `skipCreditsEnabled` and `wwwplayer.config.skip.credits.enabled`
properties initialised on Netflix pages.
The first idea was to use a content script to change these values from
`true` to `false`. However, I found that this didn't do anything, very
likely because the global configs are read at load time, and my script
didn't overwrite them early enough.
I tried setting `"run_at": "document_start"` in the `content_scripts`
manifest, but that didn't do anything either.
The next idea was to use the `webRequest` API in a background script to
rewrite these properties before the page was rendered in the browser.
The problem with that idea was that you're not allowed to modify the
response body using this API. You can only modify headers.
That's where I stopped.
Today, I picked up the project again, this time using Mitmproxy to
modify the response body and flip these two properties. The properties
were correctly set to false, but it turns out that didn't change the
windowed-video-credits behaviour. Only then did I realise that these
properties instead probably control whether the "Skip Credits" _button_
is displayed or not, and have nothing to do with the small-frame video.
This is indicated by the `skipCreditsDisplayDuration` property, which is
set to 6000, likely meaning that the button should display for 6
seconds.
I don't know why it took me so long, but the real answer is so simple
and obvious: use CSS instead. The video player is assigned different
classes once the credits start rolling. All we need to do is:
* Ensure these classes don't get applied, or their styles don't get
applied
* Ensure the "Back to Browse" button doesn't show
* Ensure the video controls still display when hovering over the video
(possibly by virtually clicking on the video)
|
|
|