Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help request] Can't get dumber gist work on Brave in an iframe. #19

Closed
bigopon opened this issue Feb 28, 2020 · 19 comments
Closed

[Help request] Can't get dumber gist work on Brave in an iframe. #19

bigopon opened this issue Feb 28, 2020 · 19 comments
Labels
bug Something isn't working

Comments

@bigopon
Copy link

bigopon commented Feb 28, 2020

Simply navigate to https://buttonwoodcx.github.io/doc-bcx-validation/examples/foreach-and-nested on Brave browser, can't seem to get it to work even when turning off the shield

Getting FS errors, something like this:
image

@3cp 3cp added the bug Something isn't working label Feb 28, 2020
@3cp
Copy link
Member

3cp commented Feb 29, 2020

I saw different error. Somehow brave prevented the nested iframe (the embedded app iframe in the dumber-gist example iframe).

__boot-up-worker.html:1 Uncaught (in promise) DOMException: Failed to register a ServiceWorker for scope ('https://5887cc0e17694eb2261c5e6d2776b600.gist.dumber.app/') with script ('https://5887cc0e17694eb2261c5e6d2776b600.gist.dumber.app/__dumber-gist-worker.js'): The user denied permission to use Service Worker.

@bigopon
Copy link
Author

bigopon commented Feb 29, 2020

So, i checked and saw this
image

The cookies at [hash].gist.dumber.app is blocked, even with my allowance for:
image

It seems [hash].gist.dumber.app is considered a different site

@bigopon
Copy link
Author

bigopon commented Feb 29, 2020

and it seems to work fine on FF for me now, after I added the same config above

@bigopon
Copy link
Author

bigopon commented Feb 29, 2020

It also works fine on Chrome after the permission above

@3cp
Copy link
Member

3cp commented Feb 29, 2020

I am confused why Chrome and Brave (save engine) requires cross-origin cookie for service worker to work.

There is no doc said service worker needs cookie at all. I could not find any clear explanation.

In comparison, even I turn on "block all cookies" in Safari, dumber-gist still works in iframe. Safari clearly didn't check cookie permission for service worker.

@3cp
Copy link
Member

3cp commented Feb 29, 2020

Dumber-gist itself uses no cookie at all.

@3cp
Copy link
Member

3cp commented Feb 29, 2020

One thing might be related, cloudflare created a cookie __cfduid on domain .dumber.ap.

@3cp
Copy link
Member

3cp commented Mar 2, 2020

@bigopon
Copy link
Author

bigopon commented Mar 2, 2020

Thats a lot of issues. Though codesandbox works for me in iframe

@3cp
Copy link
Member

3cp commented Mar 2, 2020

Probably my limited understanding on service worker.

codesandbox can fall back to use backend, that might help.

@3cp
Copy link
Member

3cp commented Mar 3, 2020

Will try sandbox attribute tomorrow https://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/

I guess both brave and safari had implicitly turned on some sandbox on iframe without sandbox attribute. They manifested into different issues.

allow-same-origin is probably the critical restriction to be lift off.

@3cp
Copy link
Member

3cp commented Mar 3, 2020

Nope :-(
It didn't help Brave with sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts".
Although the additional sandbox attribute still worked in other browsers.

@3cp
Copy link
Member

3cp commented Mar 3, 2020

It did fix brave by turning off one config in brave shields.

Cookies, from "Only block cross-site cookies" to "All all cookies".

BTW, it's hyper confusing that Chromium (and Brave) uses term "cookies" to mean "cookies, and localStorage and few other things".

@3cp
Copy link
Member

3cp commented Mar 3, 2020

Screen Shot 2020-03-04 at 9 36 40 am

Turning shields off also worked for me.

@3cp
Copy link
Member

3cp commented Mar 3, 2020

I need to detect brave browser (and shields if possible), then tell user what to do if service worker didn't boot up after timeout.

@3cp
Copy link
Member

3cp commented Mar 3, 2020

brave/brave-browser#8216

3cp added a commit that referenced this issue Mar 4, 2020
@3cp
Copy link
Member

3cp commented Mar 4, 2020

Partially addressed this issue by telling user what to do when service worker failed.

@3cp
Copy link
Member

3cp commented Apr 18, 2020

@bigopon is this considered "fixed"? Dumber gist now shows some readable error message on failed service-worker, notifies user how to get around browser issue.

@bigopon
Copy link
Author

bigopon commented Apr 18, 2020

Yes, thanks @3cp . The solution is to upgrade to latest Brave

@bigopon bigopon closed this as completed Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants