| Age | Commit message (Collapse) | Author |
|
Since it looks like everything's going to happen in the content script,
might as well make this a user script instead.
Build with Browserify in order to get a compiled JS file compatible with
browsers.
For some reason I'm currently getting an error complaining that the
`stylesheet` variable is `null`. Need to look into that.
|
|
Click the player frame to reactivate player controls. Player controls
disappear once the credits get minimised.
The problem with clicking the player frame, though, is that the controls
UI becomes visible. We want the controls DOM elements to come back, but
stay hidden.
Change the CSS class to "inactive" to hide the UI. There is a problem
with this currently: jiggling the mouse over the video after the class
is changed doesn't make the controls visible. Need to move the cursor
out of the frame and back in to reset the visibility state.
Add a couple CSS styles to hide:
* The "Back to Browse" button that appears for a second in the top left
corner of the page
* The "RATED …" label in the top left corner of the page
|
|
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.
|
|
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)
|