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

fix: recover from missing window.crypto #60

Merged
merged 1 commit into from
May 28, 2020

Conversation

lidel
Copy link
Collaborator

@lidel lidel commented May 27, 2020

This is a quick fix that detects js-ipfs init failure due to missing window.crypto.subtle and redirects to a canonical URL that is known to work in all browsers.

I also removed dead code responsible for window.ipfs

The goal here is to improve UX in Firefox with IPFS Companion until https://bugzilla.mozilla.org/show_bug.cgi?id=1220810 is fixed upstream.

This is a quick fix  that detects failure due to missing
window.crypto.subtle and redirects to a canonical URL that is known to
work in all browsers, even when IPFS Companion is enabled in Firefox

License: MIT
Signed-off-by: Marcin Rataj <[email protected]>
@lidel lidel requested a review from jessicaschilling May 27, 2020 19:20
Copy link
Contributor

@jessicaschilling jessicaschilling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea, thank you!

@lidel lidel merged commit 785e397 into master May 28, 2020
@lidel lidel deleted the fix/localhost-subdomain-load-in-firefox branch May 28, 2020 12:06
lidel added a commit to ipfs/ipfs-companion that referenced this pull request May 28, 2020
Firefox exposes full URL of a parent page in request.originUrl,
which enables us to respect redirecti opt-out not only for the parent
request, but also subresources.

This is necessary for
ipld/explore.ipld.io#60 to work in
Firefox.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants