11 Commits

Author SHA1 Message Date
Adrian Vollmer
b40354235a Improve performance by using messages
Instead of inserting the entire global context into the iframe's HTML,
where we need to encode it to and decode it from JSON and base64, we
only insert a stripped global context, i.e. without the file tree and
the utils. If these are needed in the iframe, for example when a script
changes the DOM and needs to load an image, we use messages to
communicate with the parent document and retrieve the file in question.
2024-04-27 15:44:16 +02:00
Adrian Vollmer
76f8976646 Remove debug statement 2024-04-22 20:41:29 +02:00
Adrian Vollmer
2399acaabd Fix observation of mutated elements
Needs to be installed after DOM loaded.
2024-04-22 20:28:06 +02:00
Adrian Vollmer
763c120413 Remove debug statement 2024-04-22 20:01:12 +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
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
77fc23ea00 Check for existence of global_context before access 2024-04-03 19:53:52 +02:00
Adrian Vollmer
70d3a54215 Monkeypatch more functions used by Sphinx
This also monkeypatches `URLSearchParams.delete`
and `window.history`.
2024-02-18 21:08:07 +01:00
Adrian Vollmer
25fb93219c Rename some files; fix sourceURL pragmas 2022-10-12 14:41:57 +02:00