views:

27

answers:

1

I have modified some code inside my Firefox. Just add on some extra functions for my isolation network. Besides that I also want to create my own FF extension for this particular purpose. I just need some information:

Can the code inside my Firefox, call any function Javascript declared in my extension?

A: 

Generally yes, but your question is not specific enough. Both Firefox and an extension can have JS and C code, code in XPCOM components, code running in a specific window, JS modules, etc.

Assuming the "Firefox code" is running in some window (e.g. you edit browser.js) and the "extension function" you want to call also exists in that window (e.g. you overlay chrome://browser/content/browser.xul, which is the URI of the main Firefox window, in which the browser.js code runs), you can just call it as you would normally do.

Nickolay