instance01 / Twitch-HLS-AdBlock

Block advertisements that are inserted in Twitch streams directly.
MIT License
261 stars 25 forks source link

Breaks Twitch in Firefox nightly #6

Closed Fyren closed 5 years ago

Fyren commented 5 years ago

I tried out the latest release in the latest 64-bit Firefox nightly on Windows. The result is that streams never start. The player just stays black but the controls for it "work" in that the play/pause/volume UI act as expected, there's just no video or audio. In a new, empty profile with only this extension (and turning off some content/tracker blocking off to get rid of some log messages), my browser console has only the following when trying to view a stream:

Injected Twitch Ad Blocker. injected.js:1:9
failed to resolve properties promise <unavailable> twitch-player-ui-9992686ce9d56394e1e1.js:37:57307
Autoplay is only allowed when approved by the user, the site is activated by the user, or media is muted. mediaplayer.min.js:7:23287
Content Security Policy: Ignoring ‘x-frame-options’ because of ‘frame-ancestors’ directive.
<unavailable> apstag.js:2:12743
    p https://c.amazon-adsystem.com/aax2/apstag.js:2
    <anonymous> https://c.amazon-adsystem.com/aax2/apstag.js:2
    r https://c.amazon-adsystem.com/aax2/apstag.js:2
    <anonymous> https://c.amazon-adsystem.com/aax2/apstag.js:2
    r https://c.amazon-adsystem.com/aax2/apstag.js:2
    <anonymous> https://c.amazon-adsystem.com/aax2/apstag.js:2
    <anonymous> https://c.amazon-adsystem.com/aax2/apstag.js:2

The "unavailable" line and trace below it is an error, but I don't know why there isn't actually a message attached. Maybe it's supposed to be with the earlier line about the promise, but that line is marked as warning level. I have no idea if it's related, anyway. I tried a few different streams at random with the same result.

instance01 commented 5 years ago

Let me know if 0.5.1 works for you.

Fyren commented 5 years ago

It does, thanks.

Are changes to the minified code usually going to shift that function name around? If so, would it be much effort/possible to check the version number from the URL and either warn or disable?

instance01 commented 5 years ago

That function name will change every time.

One idea would be to do a request to the original twitch blob url, extract the upstream version and if the version is mismatching, get rid of the performance fix (so we don't call zc() or whatever its current name is) and update to the upstream wasm version from the original blob. I'm not even sure the performance fix is that important and it would ensure that the extension doesn't break constantly.

If anyone is interested, PR is welcome, else I'll do when I get the time.