NeverDecaf / discord-PWA

A wrapper for the Discord web client as a PWA, made for Chromium browsers on desktop.
MIT License
145 stars 13 forks source link

discord.com refused to connect in Edge Dev 89.0.731.0 #19

Closed KibSquib48 closed 3 years ago

KibSquib48 commented 3 years ago

I just updated to Edge Dev 89.0.731.0 today and now the PWA won't work. The actual website still works so I know it's not a discord problem. It works on my chromebook on Chrome OS 87 so it may be either a Chromium 89 or Edge specific issue, and I already tried clearing cache and cookies

NeverDecaf commented 3 years ago

Is it possible the extension was disabled by the update? Without the extension installed the iframe will fail to load and display the "refused to connect" message.

May also be caused by this issue mentioned in the readme: If discord iframe does not load (despite having the extension installed) Remove and re-install the extension. This happens when multiple extensions try to modify headers for a page; the last installed extension has priority while others are blocked access.

KibSquib48 commented 3 years ago

I've already deleted and reinstalled the extension about 3 times, and made sure it was enabled, with no fix. I'll try with a new profile to see if any other extension or cache thing is conflicting

KibSquib48 commented 3 years ago

yeah just tried from a fresh profile with only the bypass extension, still broken. I also just tried on Chrome Canary and it didn't work so it's not specific to Edge, but likely a change that happened in Chromium 89

NeverDecaf commented 3 years ago

It appears Google is finally rolling out the extremely controversial manifest v3. This extension relies on the webRequest API, which Google is nerfing heavily in v3. However, Manifest v2 should still be supported, so unless webRequest is already gimped in v88 there is no reason the extension shouldn't work anymore, I will need to get a copy of v89 to test.

KibSquib48 commented 3 years ago

weird, last time the Edge team was asked about manifest v3, and more specifically about adblockers after v3 is released, they were kind of unclear but it seemed implied that they would still support v2 until it's officially dead

NeverDecaf commented 3 years ago

It appears that the modification of the X-Frame-Options header is not allowed in v89. I tried using declarativeWebRequest, which should be fine even in v3, to no success. I say appears because there is no way to check using DevTools whether the headers are actually modified by extensions or not, making it extremely difficult to actually debug this issue.

Edit: I tried the same extension (using declarativeWebRequest) in v87 and it works fine. I can only assume that Google has decided to disallow the modification of the X-Frame-Options header. Only time will tell if this is a temporary bug or intended feature, I recommend staying on version 87 for now.

Edit2: X-Frame-Options can be modified in v89, it appears something has changed that breaks my method of doing so, I should be able to fix this issue.

NeverDecaf commented 3 years ago

Please try the extension in the manifestv3 branch.

KibSquib48 commented 3 years ago

works fine now

NeverDecaf commented 3 years ago

The changes made are backwards compatible with manifest v2 but because v3 does not allow dynamic modification of headers via blocking webRequest (as far as I can tell it only allows removing/adding headers) the method used to enable third-party CSS (appending to the style-src and img-src directives) would no longer work and would require removing the Content-Security-Policy header entirely, which is a much larger vulnerability than the v2 solution (thanks Google).

Additionally, there doesn't appear to be any way to inject CSS or Javascript that isn't bundled with the extension, so if Google doesn't change their stance on that then the custom style/script feature won't work at all in manifest v3. I will hold off on merging this branch until the spec matures a bit to see if there will be a way to bypass these restrictions.