Permalink
Browse files

Removed old message proxying code from background

  • Loading branch information...
1 parent c60dcf1 commit a2f56c66391157bf9086ff377137afba43bd7ec7 @btford btford committed Jul 25, 2012
Showing with 0 additions and 43 deletions.
  1. +0 −43 js/background.js
View
@@ -1,42 +1,3 @@
-var injectPrereqs = {};
-
-var cbs = {};
-
-chrome.extension.onRequest.addListener(function (request, sender, sendResponse) {
- if (request.script === 'register') {
- chrome.tabs.onUpdated.addListener(cbs[request.tab]);
-
- } else if (request.script === 'debug-true') {
- cbs[request.tab] = (function (req) {
- return function (tabId, changeInfo, tab) {
- if (tabId !== req.tab) {
- return;
- }
- chrome.tabs.executeScript(tabId, {
- file: 'js/inject/debug.js'
- });
- };
- }(request));
- chrome.tabs.onUpdated.addListener(cbs[request.tab]);
-
- } else if (request.script === 'debug-false' && cbs[request.tab]) {
- chrome.tabs.onUpdated.removeListener(cbs[request.tab]);
- delete cbs[request.tab];
-
- } else {
- chrome.tabs.executeScript(request.tab, {
- file: 'js/inject/css-inject.js'
- }, function () {
- injectPrereqs[request.tab] = true;
- chrome.tabs.executeScript(request.tab, {
- file: 'inject/' + request.script + '.js'
- });
- });
- }
- if (sendResponse) {
- sendResponse();
- }
-});
// notify of page refreshes
chrome.extension.onConnect.addListener(function(port) {
@@ -55,8 +16,4 @@ chrome.extension.onConnect.addListener(function(port) {
});
}
});
- port.onDisconnect.addListener(function () {
- console.log('disconnected');
- });
});
-

0 comments on commit a2f56c6

Please sign in to comment.