Skip to content

Instantly share code, notes, and snippets.

@artisanalcode
Created April 28, 2016 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artisanalcode/a3c68494380ff5ac5add1dfe87328138 to your computer and use it in GitHub Desktop.
Save artisanalcode/a3c68494380ff5ac5add1dfe87328138 to your computer and use it in GitHub Desktop.
Executes code conditionally based on URL.
/**
* Checks current URL, executes specified content only on non-"blacklisted" URLs.
*/
(function () {
if (!/^\/url-segment-here>|^\/another-url-segment-here|^\/as-many-url-segments-as-needed-here/.test(window.location.pathname)) {
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment