Skip to content

Instantly share code, notes, and snippets.

@plugnburn
Last active August 29, 2015 14:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plugnburn/e11accf7f9a3ae5c5877 to your computer and use it in GitHub Desktop.
Save plugnburn/e11accf7f9a3ae5c5877 to your computer and use it in GitHub Desktop.
DualWarp - a universal bootloader for data:URIs and external scripts to be usable in redirectable URLs

Overview

DualWarp is a simple 134-byte bootloader for URIs and external scripts. It was created for users who want their data: URIs and external script to be allowed for shortening and cloaked execution. You just host this single HTML file and then pass whatever you want (data: URI or external Javascript link) into the URL hash.

Usage

Note that when you call external script, it may be served as any MIME-type, so hacks like [Giffer] (https://gist.github.com/plugnburn/3364bc56ecc820534143) will also work when your JS is embedded into a GIF and uploaded to an image hosting.

<!DOCTYPE HTML><script>/^data/i.test(l=location.hash.substr(1))?location=l:document.write("<script src='"+l+"'>\x3c/script>")</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment