Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
- autoupdating
Binary file added dist/firephp-0.5.0.crx
Binary file not shown.
4 changes: 2 additions & 2 deletions src/html/dev_tools.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<html>
<head>
<script src="../js/dev_tools.js?v2"></script>
<script src="../js/dev_tools.js"></script>
</head>
</html>
</html>
17 changes: 13 additions & 4 deletions src/js/background.js
Original file line number Diff line number Diff line change
@@ -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: ["<all_urls>"]},
/* array of string */ extraInfoSpec
);

Expand All @@ -37,4 +44,6 @@ chrome.extension.onRequest.addListener(
);
}
}
);
);

console.log("Completed BG Page Load");
10 changes: 7 additions & 3 deletions src/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var Bootstrap = (function (){
type: STABLE,
ns : chrome
};

} else if (chrome.experimental && chrome.experimental.webRequest) {
ns = {
type: EXPERIMENTAL,
Expand All @@ -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) {
Expand Down Expand Up @@ -78,19 +82,19 @@ 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"); }
);
});

}
};

})();
})();
2 changes: 1 addition & 1 deletion src/js/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@
}
);

})();
})();
6 changes: 3 additions & 3 deletions src/js/dev_tools.js
Original file line number Diff line number Diff line change
@@ -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
});
});
});
3 changes: 2 additions & 1 deletion src/js/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ),
Expand All @@ -48,7 +49,7 @@ var Logger = (function(){
});
}
} else {
//console.warn('not logging info', item);
console.warn('not logging info', item);
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -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://*/*",
Expand Down