sammacbeth / dat-fox

dat:// protocol as a Firefox webextension
MIT License
250 stars 12 forks source link

dat-fox breaks the URL global object #34

Closed terrygonguet closed 5 years ago

terrygonguet commented 5 years ago

This extension replaces window.URL with its own constructor and thus makes its static methods unavailable (URL.createObjectURL() and URL.revokeObjectURL()). I haven't looked into fixing it yet but it should be trivial.

jeremyredhead commented 5 years ago

It replaces window.URL with npm package url-parse. I suspect the offending line may be removed entirely, but I haven't tested this. (For reference, Beaker Browser appears to have the normal URL constructor)

Also, the fact that DatArchive is exposed & URL overridden on every single http page could potentially be used for fingerprinting I think. So there should probably be an option to change that behavior.

sammacbeth commented 5 years ago

Yes. This was required due to inconsistent parsing of unknown URLs by Firefox's URL implementation (bugzilla). Since this bug was fixed dat is whitelisted as a known protocol, so URL behaves correctly. That means, going forward, this polyfill could be removed.