From ba19ccb2104d5bc236bce32876f1335e230c6f87 Mon Sep 17 00:00:00 2001 From: qt31415926 Date: Thu, 2 Apr 2015 00:36:10 -0400 Subject: [PATCH] changes, things will never be the saaaamee --- background.html | 2 +- background.js | 6 ++---- js/checkerino.js | 6 +++--- js/verify.js | 1 - manifest.json | 5 +++-- options.html | 34 ++++++++++++++++++++++++++++++++++ 6 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 options.html diff --git a/background.html b/background.html index 0b6fd1a..a3d84b1 100644 --- a/background.html +++ b/background.html @@ -56,7 +56,7 @@ --> -
+

Read and type the text below if you REALLY HAVE to go to your site:

diff --git a/background.js b/background.js index ede6033..14e433e 100644 --- a/background.js +++ b/background.js @@ -1,13 +1,11 @@ -var blockChecker, +var globalOptions, + blockChecker, blockList, blockService; blockService = BlockListFactory.getBlockList(); blockService.set(DefaultList); blockList = blockService.get(); -console.log(blockList); - -console.log("did background.js load properly"); blockChecker = new BlockCheck(DefaultList); var prevSite = ""; diff --git a/js/checkerino.js b/js/checkerino.js index da47585..dd30025 100644 --- a/js/checkerino.js +++ b/js/checkerino.js @@ -38,11 +38,11 @@ var BlockCheck = function(blocklist){ this.blocklist = blocklist; this.redirectOnMatch = function(req){ - console.log(req); var blocked = regexMatching(blocklist, req.url) && (req.tabId!==prevTabId) ; - if (blocked){ + if (blocked && req.method=="GET"){ + console.log(req); storedUrl = req.url; - prevTabId= req.tabId; + if (req.tabId!==chrome.extension.getURL) prevTabId= req.tabId; return { redirectUrl : chrome.extension.getURL("background.html") }; diff --git a/js/verify.js b/js/verify.js index 486dd4d..30a80fd 100644 --- a/js/verify.js +++ b/js/verify.js @@ -20,7 +20,6 @@ window.onload = function setupUpdater(){ , count=document.getElementById('message') , targetText = defSayings[Math.floor(Math.random()*defSayings.length)] , a = FuzzySet([targetText]) - , oldText=input , timeout=null; set(target, targetText); diff --git a/manifest.json b/manifest.json index edd62ba..ecc9dfb 100644 --- a/manifest.json +++ b/manifest.json @@ -1,8 +1,8 @@ { "manifest_version": 2, - "name": "MAD - Mindfulness Anti Distraction", + "name": "MAD - Mindful Anti Distraction", "description": "This extension will hopefully help you be less distracted (untested)", - "version": "0.1.0.2", + "version": "0.1.0.4", "background": { "scripts": ["js/checkerino.js","background.js"], "pages": ["background.html"] @@ -23,6 +23,7 @@ "activeTab", "webRequest", "webRequestBlocking", + "storage", "", "tabs" ] diff --git a/options.html b/options.html new file mode 100644 index 0000000..fe457b0 --- /dev/null +++ b/options.html @@ -0,0 +1,34 @@ + + + + MAD Options + + + + + + + +
+

Options

+
+ +Favorite color: + + + + +
+ + + + +