Inspector and Web Console are two separate tools that normally don't interact. In fact, it's possible for Inspector to be loaded while Web Console isn't. What gets loaded into the browser is chrome://browser/content/devtools/framework/toolbox.xul
- that's the toolbar displaying all registered tools (there is a generic API to register tools). When a particular tool is selected, it gets loaded into an <iframe>
inside toolbox.xul
, this can be inspector.xul
or webconsole.xul
. The latter loads webconsole.js
then.
In other words, you cannot really use functionality of the web console from the inspector, at least not reliably. The best solution would be copying the parts you need from webconsole.js
into your code - that way it will work regardless of how developer tools change in future.