in-web-browsers
in-web-browsers copied to clipboard
Create Check Page for Distributed Web
The Tor project has a simple page that can be used to reliably determine if one is using Tor network or not: https://check.torproject.org
I think we should have a similar page (at check.ipfs.io or safer check.dweb.link). I imagine it as a static HTML + JS with heuristic tests that reliably determine if the page itself was loaded over HTTP or IPFS (be it web extension, HTTP gateway etc)
Rationale:
- it would make it easier for non-technical people to test connectivity
- IPFS-enabled browsers could have it as a default staring page
- browser extension could have "test connectivity" button on Preferences screen that opens it for a quick test
- having a well known, neutral connectivity test simplifies making various demos and decreases cognitive load on the audience
Idea 1) Perhaps we could reuse designs made by @nunofmn for https://github.com/ipfs/ipfs-companion/issues/324 here ? This "Check Page" would serve similar purpose to the post-install Landing Page in browser extension: connectivity check + next steps / learning materials.
Idea 2) What if we keep wording/design generic enough to use original "Check Page" in extension?
I'm happy to build a page for this. Any ideas how to test for it? I feel like "how did i get here?" isn't the sort of info that the rendered page has access to.
Would we settle for checking the address bar for one of the ipfs address formats?
- URL - ipfs://QmHash
- URI - dweb:/ipfs/QmHash
- NURI - /ipfs/QmHash
It feels along way from reliable, but I can't think of anything else, without having something injected into the response. There is work underway to have window.ipfs be available on all pages when ipfs-companion is running, so that could be part of it, but that's much more specific.
I'm using http://ipfs.io/ipfs/QmP2yCrvuL89kgCxtt5vXfPMt89PtidxQ8yKTr86gtYZd4 for testing the brave integration work... so i do see the need for some kind of simple test page.
I think we will end up with a set of tests that work together.
Some ideas:
window.location.href(crude test: if it is different than hard-coded domain, we can guess that someone is using ipfs-companion and redirect loaded it from a custom gateway)- Address bar (is there a dedicated API for accessing it in Brave? or is via
window.location?) - To remove false-positives from gateway detection, we can send a XHR to
/api/v0/version– it should be available on every HTTP gateway:http://127.0.0.1:8080/api/v0/version(we probably need to exclude public one at https://ipfs.io/api/v0/version 🙂 ) - Is
window.ipfspresent?
Some prior art from @VictorBjelkholm
https://ipfs.io/ipfs/QmcVc8eQiWkR23wMKiQjipLRSjCxR1FEj4TL99aY89J83d
Via https://github.com/ipfs/in-web-browsers/issues/42#issuecomment-281382909
Just serve a page over HTTP that says "No" and add a page to IPFS with dnslink on that domain that says "Yes" -- no javascript needed :)