Skip to content

Instantly share code, notes, and snippets.

@0xallie
Last active July 11, 2018 15:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xallie/33a672bc8a4a255598d0 to your computer and use it in GitHub Desktop.
Save 0xallie/33a672bc8a4a255598d0 to your computer and use it in GitHub Desktop.
NoScript surrogates for pastebins

These are NoScript surrogates for some pastebins that require JavaScript but offer a raw version. The surrogates allow you to view pastes, but not create new pastes.

dropb.in

noscript.surrogate.dropbin.replacement = location.replace("/t" + location.pathname);
noscript.surrogate.dropbin.sources = !dropb.in
noscript.surrogate.dropbin.exceptions = ^https?://dropb\.in/(?:t/|$)

hastebin.com

noscript.surrogate.hastebin.replacement = location.replace("/raw" + location.pathname.slice(0, location.pathname.indexOf(".")));
noscript.surrogate.hastebin.sources = !hastebin.com
noscript.surrogate.hastebin.exceptions = ^https?://hastebin\.com/(?:raw/|$)

pastebin.com

Although this site works without JavaScript, it's filled with ads. An ad blocker tends to get rid of them, but here it is anyway.

noscript.surrogate.pastebin.replacement = location.replace("/raw.php?i=" + location.pathname.slice(1));
noscript.surrogate.pastebin.sources = !^https?://pastebin\.com/[a-zA-Z0-9]{8}$
noscript.surrogate.pastebin.exceptions = ^https?://pastebin\.com/[a-z]{8}$

(The exceptions are for things like /settings. It may cause false negatives, but I haven't noticed any yet, and it's better than breaking other parts of the site, in case you actually want to use them.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment