12 Commits

Author SHA1 Message Date
Adrian Vollmer
8aa570030b Rename some files; also finish some work from prev commit 2024-04-21 17:35:29 +02:00
Adrian Vollmer
54fda10acc Embed pre and post scripts in javascript
This also removes the dependency on beautifulsoup.
2024-04-21 17:35:15 +02:00
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
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
648a962ca4 Fix double execution 2024-04-03 20:31:56 +02:00
Adrian Vollmer
e798b329a9 Copy missing functions to inject_pre.js
This should fix #6.

(Code duplication should be avoided though...)
2024-03-26 18:29:33 +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
c24f30f5ec Fix error with about:srcdoc links; add extra check 2022-10-16 19:18:24 +02:00
Adrian Vollmer
068f2db12c Fix links with leading slash 2022-10-12 15:27:51 +02:00
Adrian Vollmer
25fb93219c Rename some files; fix sourceURL pragmas 2022-10-12 14:41:57 +02:00