14 Commits

Author SHA1 Message Date
Adrian Vollmer
2e8a3ee989 Use camel case in JS 2024-04-21 16:23:03 +02:00
Adrian Vollmer
ac664c27a1 Avoid manually triggering DOMContentLoaded
It confuses scripts when it is triggered twice. Instead of passing the
global context, we simply write it into the HTML of the iframe.
We need to encode it in base64 to avoid context confusion (e.g. `</script>`
inside the JSON of the global context).
2024-04-21 15:37:23 +02:00
Adrian Vollmer
9faf9ca98b Add URL pragma of main.js in python code 2024-04-21 14:56:22 +02:00
Adrian Vollmer
58da889112 Rename iframe 2024-04-09 17:56:04 +02:00
Adrian Vollmer
b9e88c0fa9
Fix wrong boolean logic in embed_css 2024-04-09 13:44:06 +02:00
Adrian Vollmer
bd6ad1fc69 Soften URL pattern
Apparently, only one dash is also allowed.
2024-04-08 18:55:10 +02:00
Adrian Vollmer
b37d287cc6 Fix fetch monkey patch
Wait for `global_context` to exist. Fix bug with b64 encoding. Respect
mime type.
2024-04-08 18:54:49 +02:00
Adrian Vollmer
d0a6ba478e Don't embed eternal CSS resources 2024-04-08 18:53:29 +02:00
Adrian Vollmer
f7530f8ff9 Fix source URL pragmas 2024-04-03 20:17:43 +02:00
Adrian Vollmer
ec6c845a11 Fix HTML entities inside style elements
This patch causes the contents of the file to be inserted verbatim into
the style element.
2024-03-26 18:25:19 +01:00
Adrian Vollmer
2b870da3cb Process DOM of virtual HTML file before rendering
With this commit, the virtual HTML file is processed before it's fed to
the iframe and thus rendered. With the previous approach, script tags
with inline JavaScript were executed first and script tags with a
virtual `src` were executed last. This messed up the execution flow of
the document.
2024-02-18 21:05:51 +01:00
Adrian Vollmer
6aaa3841d2 Create the iframe without display='none'
This is important for JavaScript programs like mermaid, which initialize
an svg based on the actual size of the parent div.

See #5
2024-02-18 21:02:36 +01:00
Adrian Vollmer
c24f30f5ec Fix error with about:srcdoc links; add extra check 2022-10-16 19:18:24 +02:00
Adrian Vollmer
25fb93219c Rename some files; fix sourceURL pragmas 2022-10-12 14:41:57 +02:00