-
Notifications
You must be signed in to change notification settings - Fork 13
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
Foreign Fetch for Service Workers #32
Comments
I was also suggested to read through these when talking to people involved in standards bodies |
Another thing I'll be attempting to figure out is what the status of this spec https://w3c.github.io/webappsec-suborigins/ ? I think given the raise in popularity of IPFS there is a chance to advocated for getting it in browsers. What's position with-in Mozilla is for this work |
Alright I have spend quite some time discussing double-keying & foreign-fetch with people who work on this in Firefox and I think I have better understanding now. Bad news is it's unlikely we'll be able to succeed in making foreign-fetch comeback! Here are some key takeaways:
I was trying to make an argument for allowing sharing same SW instead, but that seems to raise different concerns:
I also got some suggestions along the way
|
I think exploring |
Linking this issue here mozilla/standards-positions#31 I was also told that spec has a number of unsolved problems and nobody is driving it. |
I think this was in reference to following spec: |
@Gozala thank you for looking into this and providing highly insightful explanation for removal of foreign-fetch. Quick feedback from IPFS front:
|
I've learned today through Master of Web Puppets: Abusing Web Browsers for Persistent and Stealthy Computation that a Service Worker will shutdown (or freeze) automatically after ~1 minute passes since the user left the Website. The main reason for this behaviour is due to security as it is described by 1 - Chrome and 2 -Firefox, why this is relevant for the Service Worker discussion is that it means that unless the user keeps the tab open where the Service Worker was installed (e.g. https://js.ipfs.io), the Service Worker will be automatically shutdown after one minute, meaning it can't be used as a Service Worker Gateway by other apps, even if foreign fetch was an implemented feature. Using an iframe might be a work around for this showstopper as well, however, it does mean that the Website builders will have to have an iframe loaded in their Website html if they want their ipfs.io Gateway urls to it a Service Worker Gateway or if they want their DApp to use the Node inside the Service Worker. |
It's not necessarily where service worker was install but rather any tab where service worker is activated meaning page with a matching origin that was loaded after SW is registered. @daviddias that is true, however foreign-fetch was supposed to allow other origins to activate the service worker, implying that different origins could have activated it. I also would like to point out that it's less about page / tab being open and more about SW serving requests. SW will be deactivated even when activating tab remains open unless SW is handling message or fetch event.
In lunet I end up using with a similar setup, except via |
I would still like for Foreign Fetch for SW to exist, even if they have different service workers as per http partitioning. Being able to issue http requests to an origin & get a reply while offline is an extremely interesting capability for the web. Even if caches and data sharing are hobbled from the extensive de-web-ification of all these new tracking-protection layers being thrown against the web. Not as useful as I want it to be, but I continue to believe, very strongly, that Foreign Fetch is the most elegant & yet powerful way to empower a fully featured, competent offline web experience. Without Foreign Fetch, we have to rely on odious backchannel means of passing data around, whereas with Foreign Fetch, http can remain the transport protocol of choice for connecting the web. Anyhow, thank you ever so much @Gozala for this wonderful issue & your fine work bringing in information on it!!! I am so impressed & so thankful & so surprised there's such a great source of information on this amazing topic. |
I have being lately exploring service workers to see if they could address some of the limitations in beaker space beakerbrowser/specs#21 which lead me to realizing that service workers may potentially unlock some of the other (than Web Extension) avenues for integrating IPFS / Dat / SSB / ... into web ecosystem, which I though I'd share here. I'll use IPFS for describing this although it should be applicable to most others just as well.
I believe that this has huge potential as it would:
https://ipfs.io/ipfs/${hash}/
but later would require no extension and other browsers could be pursued to adopt this far easier IMO.It is also worth noting that "foreign fetch" limitation can be overcome to some degree today by using proxy iframe say
<iframe src="https://ipfs.io/node" />
that could proxy all the requests received onwindow.onmessage
to a service worker and proxy responses back toevent.source
. It would no be able to:Dose this sound interesting ? Would you consider this valuable ? Would you be interested in exploring this ?
The text was updated successfully, but these errors were encountered: