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
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
648a962ca4
Fix double execution
2024-04-03 20:31:56 +02:00
Adrian Vollmer
f7530f8ff9
Fix source URL pragmas
2024-04-03 20:17:43 +02:00
Adrian Vollmer
77fc23ea00
Check for existence of global_context before access
2024-04-03 19:53:52 +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
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
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
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
815b6ac11a
Remove redundant source url pragma
2022-10-18 14:03:56 +02: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
Adrian Vollmer
d5b30f9f52
Open external links in new tab
2022-10-12 12:54:03 +02:00
Adrian Vollmer
83d3010207
Update inline LICENSE
2022-10-11 14:34:52 +02:00
Adrian Vollmer
f652131f11
Change on_scroll_to_anchor so no history entry is added
2022-10-11 14:20:09 +02:00
Adrian Vollmer
d4978d55de
Some refactoring; also fix anchor links
2022-10-11 14:08:20 +02:00
Adrian Vollmer
2bdf43629d
Monkey patch jQuery
2022-10-10 19:22:42 +02:00
Adrian Vollmer
eb0e4110a8
Fix anchor links
2022-10-10 17:41:55 +02:00
Adrian Vollmer
351582e055
Add more source pragmas
2022-10-10 17:41:41 +02:00
Adrian Vollmer
649324d576
Use main() function in inject.js
2022-10-10 17:41:22 +02:00
Adrian Vollmer
c0951bc3c0
Remove debug statement
2022-10-10 17:41:06 +02:00
Adrian Vollmer
f7701b429b
Add source pragmas to init.js and inject.js
2022-10-10 17:40:47 +02:00
Adrian Vollmer
ad4f3c838c
Properly handle mime type in embed_img
2022-10-10 14:48:11 +02:00
Adrian Vollmer
c60bee22b2
Handle non-existing favicons
2022-10-09 17:42:21 +02:00
Adrian Vollmer
9840d92932
Make 'file not found' message a warning
2022-10-09 17:42:19 +02:00
Adrian Vollmer
7a891bb14d
Include copyright notice
2022-10-09 13:04:56 +02:00
Adrian Vollmer
2ec9ca7749
Prevent error if favicon not found
2022-10-09 12:39:56 +02:00
Adrian Vollmer
3cbcb667db
Handle clicks on non-html files
2022-10-09 12:39:36 +02:00
Adrian Vollmer
851532a125
Include more information in case of JS error
2022-10-09 10:51:53 +02:00
Adrian Vollmer
369a9fd3cb
Handle non-existing files gracefully
2022-10-09 10:51:32 +02:00
Adrian Vollmer
bf36d10bc7
LICENSE underlines
2022-10-05 13:37:41 +02:00
Adrian Vollmer
0a82f2977c
Fix setup cfg, rename directory, add 3rd party licenses
2022-10-05 12:17:14 +02:00