I'm trying to make a firefox extension that creates a new panel in the devtools and log all of the URL of the scripts tag loaded in the current page. But I'm having some troubles with the communication between the panel and the inspected window. This is how it looks like:
And when you click the button it may appear in the panel all the scripts loaded.
I don't know how to communicate the panel script with the inspector of the window, I tried with postMessage but returns undefined.
Always return undefined when calling it:
This is my manifest.json:
{
"manifest_version":2,
"version":"1.0",
"name":"Panel",
"devtools_page": "devtools/devtools-page.html",
"background": {
"scripts": ["background_scripts/background.js"]
},
"permissions": [
"contextualIdentities", "cookies", "tabs", "storage", "webRequest", "<all_urls>"
],
"content_scripts": [
{
"run_at": "document_end",
"matches": ["http://*/*", "https://*/*", "<all_urls>"],
"js":
[
"main.js"
]
}]
}
I will appreciate if you may help me a bit with this.