Feature #69
[Roadmap 7][Milestone] Facilitate bundling HTML/XML/JSON and other data with a fix
0%
Description
Consider fixes like that for Google Sheets1. They heavily use document.createElement()
to construct parts of user interface in javascript. While this works, it is not as convenient, as if the interface was specified using actual HTML/XML code. Bundling pieces of HTML/XML would allow us to focus only on important things in actual scripts.
The ability to bundle other kinds of data (plain text, JSON, images, other binary files) would also be useful.
It is yet to be decided how bundled data files should be injected into page. Perhaps it would be possible to use something like <script type="application/octet-stream">**data goes here**</script>
appended at the end of document's body? Perhaps it would be safer to make the data available straight to injected scripts through global variables? Or perhaps it should be injected into DOM as base64-encoded embedded files?
Please share your thoughts.
In case of doubt, this relates to the new API
Related issues
History
Updated by koszko about 2 years ago
- Related to Feature #70: [Roadmap 7][Milestone] Add facility to replace sites' original HTML with custom one added
Updated by jahoti about 2 years ago
We definitely need to support this; the question is, as you point out, how. Using the script
tag is probably an abuse of their purpose, so I might advise against that; either of the other two options seems good, however, provided we can settle where exactly the base64-encoded files would go in the DOM.
Updated by koszko almost 2 years ago
- Description updated (diff)
To facilitate bypassing CORS we'd like to implement something like GreaseMonkey's GM_xmlhttpRequest (mentioned here). Once we do this, it'd make sense to also have the bundled resources available through it. We could also provide an API to get URLs for that content and therefore decrease the amount of copying
Updated by koszko over 1 year ago
- Subject changed from Facilitate bundling HTML/XML/JSON and other data with a fix to [Roadmap 7][Milestone] Facilitate bundling HTML/XML/JSON and other data with a fix
- Description updated (diff)
Updated by koszko over 1 year ago
- Blocks Feature #108: [Roadmap 7] Further means of user-controlled customization of sites added
Updated by colby over 1 year ago
jahoti wrote:
Using the
script
tag is probably an abuse of their purpose
Without commenting on the overall merit of the milestone:
Such "data blocks" are an officially recognized use of script elements, with appropriate instructions in the HTML spec to implementors for how to handle non-JS mimetypes.
Updated by koszko over 1 year ago
colby wrote:
jahoti wrote:
Using the
script
tag is probably an abuse of their purposeWithout commenting on the overall merit of the milestone:
Does that mean you have some comments to make but you're holding them for now? Please share with us anything that might be useful.
Such "data blocks" are an officially recognized use of script elements, with appropriate instructions in the HTML spec to implementors for how to handle non-JS mimetypes.
Thanks for noting that