firetext
firetext copied to clipboard
Add ViewerJS
This PR adds read-only support for various formats.
Implementation notes:
- This commit disables replacing scripts and links with data urls, including the origin check. Let me know if it works, if so the code can be removed.
- ViewerJS is not currently sandboxed. Doing so should work, but probably comes with a small performance penalty. That can theoretically be fixed, but not super easily. If you want, you could try adding
sandboxand comparing performance for large documents.
Integration notes:
- Various buttons don't work. The worst is "Save As", which not only doesn't work but makes you do stuff before you find out. Honorable mention for "Print", which doesn't work and is also probably impossible to make work. To add insult to injury, you don't get any errors for all those buttons.
- The fullscreen and download buttons are duplicated, but the ViewerJS ones work better currently.
- Night mode doesn't work.
- Generally, ViewerJS could be made to look more like our other editor.
If you want, I could hide the buttons that don't work. Alternatively, if someone wants to help with some of these before or after merging that's very welcome. Also, all this is why I originally opted not to go for WebODF ;), although that point is now partly moot.
Readable diff: git show -w --diff-filter=M