Browse Source

this fixes #10

pull/2/head
gorhill 10 years ago
parent
commit
8653401961
  1. 2
      src/background.html
  2. 2
      src/js/httpsb.js
  3. 33
      src/js/start.js
  4. 5
      src/js/traffic.js

2
src/background.html

@ -26,8 +26,8 @@
<script src="js/storage.js"></script>
<script src="js/pagestats.js"></script>
<script src="js/tab.js"></script>
<script src="js/traffic.js"></script>
<script src="js/uritools.js"></script>
<script src="js/traffic.js"></script>
<script src="js/useragent.js"></script>
<script src="js/messaging-handlers.js"></script>
<script src="js/start.js"></script>

2
src/js/httpsb.js

@ -73,7 +73,7 @@
if ( '.css.eot.ttf.otf.svg.woff.woff2.'.indexOf(ext) !== -1 ) {
return 'css';
}
if ( '.ico.png.gif.jpg.jpeg.'.indexOf(ext) !== -1 ) {
if ( '.ico.png.gif.jpg.jpeg.bmp.'.indexOf(ext) !== -1 ) {
return 'image';
}
return type;

33
src/js/start.js

@ -23,6 +23,16 @@
/******************************************************************************/
// rhill 2013-11-24: bind behind-the-scene virtual tab/url manually, since the
// normal way forbid binding behind the scene tab.
// https://github.com/gorhill/httpswitchboard/issues/67
µMatrix.createPageStats(µMatrix.behindTheSceneURL);
µMatrix.pageUrlToTabId[µMatrix.behindTheSceneURL] = µMatrix.behindTheSceneTabId;
µMatrix.tabIdToPageUrl[µMatrix.behindTheSceneTabId] = µMatrix.behindTheSceneURL;
/******************************************************************************/
µMatrix.turnOn();
/******************************************************************************/
@ -106,22 +116,6 @@ chrome.webNavigation.onBeforeNavigate.addListener(onBeforeNavigateCallback);
/******************************************************************************/
// Load everything
µMatrix.load();
/******************************************************************************/
// rhill 2013-11-24: bind behind-the-scene virtual tab/url manually, since the
// normal way forbid binding behind the scene tab.
// https://github.com/gorhill/httpswitchboard/issues/67
µMatrix.createPageStats(µMatrix.behindTheSceneURL);
µMatrix.pageUrlToTabId[µMatrix.behindTheSceneURL] = µMatrix.behindTheSceneTabId;
µMatrix.tabIdToPageUrl[µMatrix.behindTheSceneTabId] = µMatrix.behindTheSceneURL;
/******************************************************************************/
// Initialize internal state with maybe already existing tabs
chrome.tabs.query({ url: '<all_urls>' }, function(tabs) {
@ -178,3 +172,10 @@ chrome.tabs.query({ url: '<all_urls>' }, function(tabs) {
})();
/******************************************************************************/
// Load everything
µMatrix.load();
µMatrix.webRequest.start();
/******************************************************************************/

5
src/js/traffic.js

@ -854,6 +854,7 @@ var requestTypeNormalizer = {
/******************************************************************************/
var start = function() {
chrome.webRequest.onBeforeRequest.addListener(
//function(details) {
// quickProfiler.start('onBeforeRequest');
@ -915,11 +916,13 @@ chrome.webRequest.onErrorOccurred.addListener(
]
}
);
};
/******************************************************************************/
return {
blockedRootFramePrefix: 'data:text/html;base64,' + btoa(rootFrameReplacement).slice(0, 80)
blockedRootFramePrefix: 'data:text/html;base64,' + btoa(rootFrameReplacement).slice(0, 80),
start: start
};
/******************************************************************************/

Loading…
Cancel
Save