diff --git a/README.md b/README.md index e93cc71..76de8a4 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ FirePHP-chrome is an extension for Google Chrome to allow the Chrome console to For more details of FirePHP: http://www.firephp.org/ +Revision History +-------------- +0.5.0: Updated to support Chrome 19 changes: manifest permissons, non-experimental dev components. + How to install -------------- This extension uses Chrome's "experimental extensions" so you'll need to enable these in your browser first: @@ -69,4 +73,4 @@ TODO: ---- - support more logging types (from here: http://reference.developercompanion.com/Tools/FirePHPCompanion/Run/Examples/) - remove test service and use developer comapnion examples -- autoupdating \ No newline at end of file +- autoupdating diff --git a/dist/firephp-0.5.0.crx b/dist/firephp-0.5.0.crx new file mode 100644 index 0000000..68925c4 Binary files /dev/null and b/dist/firephp-0.5.0.crx differ diff --git a/src/html/dev_tools.html b/src/html/dev_tools.html index d1264b7..7d9499d 100644 --- a/src/html/dev_tools.html +++ b/src/html/dev_tools.html @@ -1,6 +1,6 @@ - + - \ No newline at end of file + diff --git a/src/js/background.js b/src/js/background.js index c3f18b9..f13b27d 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -1,20 +1,27 @@ var logger = new Logger(); +console.log("Firing up FirePHP Debugger"); + // Add the X-FirePHP-Version header to all requests var filter, extraInfoSpec = ["blocking", "requestHeaders"]; -chrome.experimental.webRequest.onBeforeSendHeaders.addListener( + + +chrome.webRequest.onBeforeSendHeaders.addListener( function(details) { var headers = details.requestHeaders; + + console.warn("Inserting X-FirePHP header"); + headers.push({ name : "X-FirePHP-Version", - value : "0.6" + value : "0.6.1" }); return { requestHeaders: headers } }, - /* RequestFilter */ filter, + {urls: [""]}, /* array of string */ extraInfoSpec ); @@ -37,4 +44,6 @@ chrome.extension.onRequest.addListener( ); } } -); \ No newline at end of file +); + +console.log("Completed BG Page Load"); diff --git a/src/js/bootstrap.js b/src/js/bootstrap.js index 8636395..b1e88d0 100644 --- a/src/js/bootstrap.js +++ b/src/js/bootstrap.js @@ -12,6 +12,7 @@ var Bootstrap = (function (){ type: STABLE, ns : chrome }; + } else if (chrome.experimental && chrome.experimental.webRequest) { ns = { type: EXPERIMENTAL, @@ -28,6 +29,9 @@ var Bootstrap = (function (){ //, tabId: tabId }, extraInfoSpec = ["statusLine", "responseHeaders"]; + + console.log ("using namespace: " + ns); + if ( apiNs ) { apiNs.ns.webRequest.onCompleted.addListener( function(details) { @@ -78,14 +82,14 @@ var Bootstrap = (function (){ }); */ - chrome.experimental.devtools.resources.getHAR(function(result) { + chrome.devtools.network.getHAR(function(result) { var entries = result.entries; if (!entries.length) { Console.warn("ChromeFirePHP suggests that you reload the page to track" + " FirePHP messages for all the resources"); } - chrome.experimental.devtools.resources.onFinished.addListener( + chrome.devtools.network.onRequestFinished.addListener( function () { chrome.experimental.devtools.log("test"); } ); }); @@ -93,4 +97,4 @@ var Bootstrap = (function (){ } }; -})(); \ No newline at end of file +})(); diff --git a/src/js/bridge.js b/src/js/bridge.js index 94012ce..1793d91 100644 --- a/src/js/bridge.js +++ b/src/js/bridge.js @@ -65,4 +65,4 @@ } ); -})(); \ No newline at end of file +})(); diff --git a/src/js/dev_tools.js b/src/js/dev_tools.js index 2f3073b..620c705 100644 --- a/src/js/dev_tools.js +++ b/src/js/dev_tools.js @@ -1,8 +1,8 @@ -chrome.experimental.devtools.resources.onFinished.addListener(function(resources) { - var tabId = chrome.experimental.devtools.inspectedWindow.tabId, +chrome.devtools.network.onRequestFinished.addListener(function(resources) { + var tabId = chrome.devtools.inspectedWindow.tabId, headers = resources.response.headers; chrome.extension.sendRequest({ tabId : tabId , headers : headers }); -}); \ No newline at end of file +}); diff --git a/src/js/logger.js b/src/js/logger.js index b09ccc4..a699908 100644 --- a/src/js/logger.js +++ b/src/js/logger.js @@ -29,6 +29,7 @@ var Logger = (function(){ log: function ( headers ) { var logMessages = []; for ( item in headers ) { + console.log("header" + item); var logKey = item.match(this.logging[0]); if (logKey) { var commandParts = headers[item].match( this.commandMessage ), @@ -48,7 +49,7 @@ var Logger = (function(){ }); } } else { - //console.warn('not logging info', item); + console.warn('not logging info', item); } } diff --git a/src/manifest.json b/src/manifest.json index ba1ecaa..213173b 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,11 +1,14 @@ { "name": "FirePHP-chrome", - "version": "0.3.0", + "version": "0.5.0", "description": "FirePHP-chrome is an extension for Google Chrome to allow the Chrome console to display FirePHP messages.", "permissions": [ + "background", "experimental", "tabs", + "webRequest", + "webRequestBlocking", //"history", /* Request permissions for all sites */ "http://*/*",