ipfs / in-web-browsers

Tracking the endeavor towards getting web browsers to natively support IPFS and content-addressing
https://docs.ipfs.tech/how-to/address-ipfs-on-web/
MIT License
348 stars 29 forks source link

Identify Browser Features we Rely on or Want to See #35

Open flyingzumwalt opened 7 years ago

flyingzumwalt commented 7 years ago

Delivarables:

flyingzumwalt commented 7 years ago

@lgierth do you have any ideas of initial things to put in these lists? @diasdavid? @jbenet? @dignifiedquire?

dignifiedquire commented 7 years ago

What we use

What we want

ghost commented 7 years ago

stuff we use:

stuff we'd like to see

dignifiedquire commented 7 years ago

Updated my comment to be a bit more specific

kumavis commented 7 years ago

I've seen some automated tools out there that parse code for web api usage, can't remember any sepcifics

kumavis commented 7 years ago

streaming support for fetch

I believe this is a thing. just some weird browser standard promisy pull-stream like thing. poor adoption currently.

https://developer.mozilla.org/en-US/docs/ReadableStream https://developer.mozilla.org/en-US/docs/ReadableStream#Browser_compatibility

fetch('/big-data.csv')
.then(function(response) {
  var reader = response.body.getReader();
  search()
  function search() {
    return reader.read().then(function(result) {    
      if (result.done) {
        // ...
      }
      return search()
    })
  }
})
dignifiedquire commented 7 years ago

@kumavis it's a thing, but only usable in Chrome, so it's like it doesn't exist effectively

daviddias commented 7 years ago

@dignifiedquire @lgierth awesome list!

One more thing we use:

What we also want:

jefft0 commented 7 years ago

An IndexedDB connection can only access databases associated with the origin of the global scope from which the connection is opened. If the browser thinks the URI of an IPFS page being viewed is a different origin than another page, then they can't share an IndexedDB database, such as cached IPFS blocks. I'm curious, have you found a way around the origin restrictions?

haadcode commented 7 years ago

Adding to the list of features we use (front end side):

Want to use in the future:

kumavis commented 7 years ago

@jefft0 could make a special gateway that works like this ${cid}.ipfs.io/index.html edit: except the cid would need to be in a case-insensitive encoding

jefft0 commented 7 years ago

@kumavis I believe the same-origin policy requires the entire host to be the same. So the different ${cid} would make it a different host and origin.

kumavis commented 7 years ago

@jefft0 Oh ok I misunderstood which you wanted (isolation vs unification). I have a project that exposes the ethereum blockchain app api to a webapp and unifies the cache inside an iframe. Seems like something similar would be useful here.

[small ipfs-iframe lib] <-> [ipfs node in iframe] <-> [network]

We're also exploring making the node a singleton by using ServiceWorker.

[small ipfs-iframe lib] <-> [ipfs iframe proxy] <-> [ipfs node in serviceworker] <-> [network]

I'm sure theres a few gotchas with this approach, especially that webrtc may not be available in the SW.

ghost commented 7 years ago

@haadcode @VictorBjelkholm @Kubuxu did anything come up in the windows.ipfs work which would be worth adding here?

victorb commented 7 years ago

@lgierth I'm currently having issues that sure, could be easier but after talking with web extension people at Mozilla, things should be able to work. Mainly I'm having troubles passing down objects created in background-context to the web page, but we should be able to work around that.

ghost commented 7 years ago

Support for DNS lookups or at least TXT lookups was rejected on the mozilla tracker: https://bugzilla.mozilla.org/show_bug.cgi?id=1343849#c3

lidel commented 6 years ago

Pushing support for DNS TXT once again, this time on the shoulders of newly added WebExtensions API: