Feature #32
Process HTML files in data: URLs instead of just blocking them
0%
Description
Content scripts are said not to get loaded to pages opened from data: URLs. We're currently blocking data: page links entirely. We could, however, make it better and parse each data: URL as HTML, sanitize the resulting document and encode it back into a data: URL.
History
Updated by koszko almost 2 years ago
It might be possible to utilize this API:
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler
Updated by jahoti almost 2 years ago
It might be possible to utilize this API:
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler
Unfortunately not, according to https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler#permitted_schemes the API can't be used to register a handler for data:
, nor can the more powerful manifest key protocol_handlers
.
Updated by koszko almost 2 years ago
:/
Btw, I've been unaware of that manifest key. It would be cool to utilize it for something else at some point :) Although I haven't found any evidence of it being supported in Chromium :/
Updated by jahoti almost 2 years ago
Btw, I've been unaware of that manifest key. It would be cool to utilize it for something else at some point :) Although I haven't found any evidence of it being supported in Chromium :/
It would indeed seem it isn't; nevertheless, working around that using navigation.registerProtocolHandler
and some request redirection might be possible. The biggest problem is probably deciding exactly what to do :).