A quick port of GitHub/BitBucket HTML preview for use with Codeberg. https://htmlpreview.codeberg.page/
This repository has been archived on 2020-11-03. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
Go to file
n e87232032c Update example to codeberg.page 2020-11-03 15:14:50 +09:00
LICENSE Initial port for Codeberg 2020-09-07 22:43:42 +09:00
README.md Initial port for Codeberg 2020-09-07 22:43:42 +09:00
htmlpreview.js Merge branch 'master' of https://github.com/htmlpreview/htmlpreview.github.com into main 2020-11-03 14:48:48 +09:00
index.html Update example to codeberg.page 2020-11-03 15:14:50 +09:00

README.md

Codeberg HTML Preview

Many Codeberg repositories don't use Codeberg Pages to host their HTML files. Codeberg HTML Preview allows you to render those files without cloning or downloading whole repositories. It is a client-side solution using a CORS proxy to fetch assets.

If you try to open raw version of any HTML, CSS or JS file in a web browser directly from Codeberg, all you will see is a source code. Codeberg forces them to use the "text/plain" content-type, so they cannot be interpreted. This script overrides it by using a CORS proxy.

Usage

In order to use it, just prepend this fragment to the URL of any HTML file: http://htmlpreview.codeberg.eu/? e.g.:

What it does is: load HTML using CORS proxy, then process all links, frames, scripts and styles, and load each of them using CORS proxy, so they can be evaluated by the browser.

License

© 2019 Jerzy Głowacki under Apache License 2.0.