views:

46

answers:

1

I searched for a bit and couldn't find a 100% decisive answer.

Can you include a server-sided language file (especially php) in a Google Chrome extension?

I have a feeling that the answer is a 'no'. So, can you include it in some other way?

If the answer is again a no, then how does FireBug find the HTTP requests (I'm talking specifically about the net panel)?

Thank you in advance.

A: 

There is no "server side" in chrome extensions. So no php.

You can communicate with remote server that has PHP installed though. You can read more about it here.

About detecting HTTP request. FF extensions have much more power than Chrome and have wider access to browser's internal API. Firebug Lite for Chrome is not able to track HTTP requests yet.

If you need to track HTTP requests there might be a solution though. Take a look at this bug report:

A partial solution to this problem is now available. Chrome now contains an event accessible to content scripts called "beforeload". For example:

document.addEventListener("beforeload", function(event) { 
  console.log("Caught resource load"); 
}, true); 

This would fire for every resource load in the document. event.preventDefault() should block the resource from loading.

Seems like it should do the trick, but I haven't tried it myself yet.

serg