gort818 / qtwebflix

A qt webengine program for netflix
GNU General Public License v3.0
245 stars 29 forks source link

Request disable netflix autopreview #44

Closed ryanmusante closed 2 years ago

ryanmusante commented 5 years ago

Is this possible to incorporate? It is chrome compatiblity.

Harken back to the glory days of no weird hover states, autoplaying videos, and annoying Who's Watching prompts.

https://chrome.google.com/webstore/detail/netflix-classic/mokjkiliipanjhlfbpagnmlpihmaohde

gort818 commented 5 years ago

I cannot implement extensions into qtwebengine, I might be able to disable the auto preview with javascript.. but I don't really know javascript sooo I'm not sure.

gort818 commented 5 years ago

@ryanmusante Good news! figured it out this is how it looks when you load netflix screenshot from 2019-01-03 14-51-31

gort818 commented 5 years ago

@ryanmusante but bad news not quite sure how to implement it :(

document.getElementsByClassName('billboard-row')[0].setAttribute('style', 'display:none')
gort818 commented 5 years ago

I found a hacky solution that would work well with some cool new features coming.. stay tuned

ryanmusante commented 5 years ago

Sounds good!

gort818 commented 5 years ago
QString code ="try { " \
                           "billboard = document.querySelector('.billboard-row');"\
                           "if (billboard) {" \
                           "var video = document.querySelector('video');" \
                           "video.muted = true;"\
                           "video.playbackRate = 0;"\
                           "video.setAttribute('preload', 0);"\
                           "video.setAttribute('autoplay', 'false');"\
                           "video.pause();"\
                           "}" \
                           "} catch (e) {  } " ;

             webView()->page()->runJavaScript(code);

This seems to work! it is not pretty but there will be no more autopreview crap

gort818 commented 5 years ago

netflix

Here is how it looks now just need to find a way for users to opt in.

ryanmusante commented 5 years ago

It works, simply amazing! So, to opt-in, some possible suggestions:

  1. Selection that can be accessed from the corner or inside of windowed mode
  2. Selection at application launch, so that if users need to switch, it requires exiting and re-doing
  3. Selection available from right-clicking interface and choosing from drop down menu
gort818 commented 5 years ago

I think option 2 is the best just have a command line argument like -na for no auto play. Will work on this today, I'll let you know when it is ready.

ryanmusante commented 5 years ago

This makes use of command line arguments and uses qt web engine for comparison. https://github.com/magiruuvelvet/LightweightQtDRMStreamViewer

gort818 commented 5 years ago

@ryanmusante qtwebflix has command line arguments, just haven't implemented this yet sorry :( maybe this weekend

ryanmusante commented 4 years ago

Status update for feature implement?