This file contains hidden or 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
| /** | |
| * Creates a RegExp from the given string, converting asterisks to .* expressions, | |
| * and escaping all other characters. | |
| */ | |
| function wildcardToRegExp (s) { | |
| return new RegExp('^' + s.split(/\*+/).map(regExpEscape).join('.*') + '$'); | |
| } | |
| /** | |
| * RegExp-escapes all characters in the given string. |
This file contains hidden or 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
| // this is the background code... | |
| // listen for our browerAction to be clicked | |
| chrome.browserAction.onClicked.addListener(function (tab) { | |
| // for the current tab, inject the "inject.js" file & execute it | |
| chrome.tabs.executeScript(tab.ib, { | |
| file: 'inject.js' | |
| }); | |
| }); |
This file contains hidden or 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
| (function(XHR) { | |
| "use strict"; | |
| var stats = []; | |
| var timeoutId = null; | |
| var open = XHR.prototype.open; | |
| var send = XHR.prototype.send; | |