Skip to content

Instantly share code, notes, and snippets.

@autonome
Created September 20, 2018 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save autonome/818ad57984c90c296b8b4340562bf37f to your computer and use it in GitHub Desktop.
Save autonome/818ad57984c90c296b8b4340562bf37f to your computer and use it in GitHub Desktop.
<dietrich> asuth: do you know anything about whether indexedb should be available for pages that are non-http/s protocols? looks like it worked until 63.
<dietrich> (or who would know?)
<mconley> dietrich: maybe bevis?
<asuth> dietrich: Are you actually creating origins under new protocols? Many things won't like that.
dietrich: QuotaManager won't create directories for origins it doesn't understand. Here's the "okay" list: https://searchfox.org/mozilla-central/source/dom/quota/ActorsParent.cpp#8462
<asuth> dietrich: In particular, are the protocols implemented via https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/protocol_handlers? Because if so I'd expect the semantics to conform to those of https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
dietrich: And in particular the clause ```User agents must throw a "SecurityError" DOMException if the resulting URL record has an origin that differs from the origin specified by the relevant settings object of this NavigatorContentUtils object.```
<dietrich> mconley: ok thanks!
asuth: yes, new origins under new protocols, iiuc. thanks for the links, will dig through that!
asuth: yep, and the protocols are in that list
<dietrich> asuth: well the WebExtension approach operates differently than that whatwg spec though, right? with registerProtocolHandler from a web page, that URL origin is used for as origin for things like IndexedDB. but when an extension does it... what origin is used?
<asuth> The extension has a "moz-extension:GIBBERISH" origin
<dietrich> asuth: so we'd need to add moz-extension:GIBBERISH support to QuotaManager and everything else... or some kind pluggable origin definition support everywhere?
<dietrich> asuth: hm, and i wonder why it changed from 62->63... nothing in blame around there looks recent enough
<asuth> dietrich: I guess step 1 is to figure out if pages loaded via these protocols are actually getting origins using the "dweb" scheme or whatever. If the answer is "yes, a dweb origin is being created", then I think that's a problem because it's not what the rest of the platform signed up for. The tests for the webextension feature certainly don't seem extensive enough for that.
dietrich: We changed the behavior around QuotaManager creating directories it couldn't later parser.
r/parser/parse/.
dietrich: If the answer is it's all happening under the webextension's origin, then there's probably just a bug somewhere and a minimal webextension example would be great.
<dietrich> asuth: great, thanks - will commence with step 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment