Skip to content

html-view/html-view.github.io

 
 

Repository files navigation

Enhanced HTML Preview

Enhanced version of the HTML Preview project with support for multiple parameters.

Overview

This project is an enhanced version of the HTML Preview project that allows rendering HTML files from git repositories (like GitHub, GitLab, BitBucket, etc.) or URL's directly in your browser without cloning or downloading the repository.

The enhanced version adds support for multiple parameters that allow customizing the preview experience.

Warning

Freely hosted CORS (Cross-origin resource sharing) proxies - like the ones used by this script - are a potential security risk!

Warning

If a script stores sensitive data (as cookie, localStorage, etc...), then other repos you open will also have access to this data.

How to avoid risk:

  • Don't input sensitive data while previewing
  • Clear all site data after previewing a repo

Currently supported git forges:

  • GitHub
  • BitBucket
  • GitLab
    • gitlab.com
    • lab.allmende.io
    • gitlab.opensourceecology.de
  • ForgeJo
    • codeberg.org
  • SourceHut
  • Gitea

We have a collection of the file URLs for the above.

How it works

If you try to open raw version of any HTML, CSS or JS file in a web browser directly from GitHub, all you will see is its source code. GitHub forces them to use the "text/plain" content-type, so they cannot be interpreted in their native form by the browser.

Usage

In order to use it, just prepend this fragment to the URL of any HTML file: https://html-view.github.io/?url= e.g.:

What it does:

  1. Load HTML using CORS proxy
  2. Process all links, frames, scripts and styles, and
  3. Load each of them using CORS proxy, so they can be evaluated by the browser.

Git-Forge HTML Preview was tested under the latest Google Chrome and Mozilla Firefox (in 2012).

About

Enchanced HTML Preview for git-forge Repositories

Resources

License

Stars

Watchers

Forks

Languages

  • JavaScript 70.6%
  • HTML 17.7%
  • Shell 11.7%