Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/embeddedt/mimecdn
Client-side tool for showing HTML files on GitHub
https://github.com/embeddedt/mimecdn
Last synced: about 21 hours ago
JSON representation
Client-side tool for showing HTML files on GitHub
- Host: GitHub
- URL: https://github.com/embeddedt/mimecdn
- Owner: embeddedt
- License: mit
- Created: 2019-06-23T21:02:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-20T20:37:25.000Z (over 5 years ago)
- Last Synced: 2024-11-06T13:56:42.364Z (about 2 months ago)
- Language: HTML
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mimecdn
Client-side tool for showing HTML files on GitHub## How to use
Visit `https://embeddedt.github.io/mimecdn/index.html?rawurl=`.
Example: https://embeddedt.github.io/mimecdn/index.html?rawurl=https://raw.githubusercontent.com/littlevgl/lv_micropython/dev-6.0/ports/javascript/lvgl_editor.html
## How does it work?
Normally, when accessing raw HTML files on GitHub, they are served with a MIME type of `text/plain`. This tells the browser not to actually treat the file as HTML, but rather as a plaintext file (`.txt`).
MimeCDN gets around this issue by ignoring the MIME type, and manually reading the file. (This is where the name "MimeCDN" came from.) The contents of the MimeCDN document are then replaced by the contents of your URL. The code's pretty simple and self-explanatory; you can read that for more information.
One cool thing about MimeCDN is that there is no server-side logic happening. All of this is handled directly within your browser. No extensions or anything special is required. Just fill in the `rawurl` query parameter with your URL, and everything is handled automagically.
## Limitations
Currently, this only works with plain HTML. CSS might work but could have issues. JavaScript won't work properly in most (all?) cases.