Created
November 22, 2015 21:29
-
-
Save jtbandes/668f719223130f250bc3 to your computer and use it in GitHub Desktop.
Be Productive — a barebones Chrome extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var urlsToBlock = [ | |
// matches manifest.json | |
"*://*.reddit.com/*" | |
]; | |
function handleRequest(details) { | |
return {cancel: true}; | |
} | |
chrome.webRequest.onBeforeRequest.addListener(handleRequest, {"urls": urlsToBlock}, ["blocking"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"manifest_version": 2, | |
"name": "Be Productive", | |
"author": "Jacob Bandes-Storch", | |
"version": "0.1", | |
"description": "Block Reddit and other such generally unproductive things.", | |
"permissions": [ | |
"webRequest", | |
"webRequestBlocking", | |
"*://*.reddit.com/*" | |
], | |
"background": { | |
"scripts": ["background.js"] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment