1

I have a web extension (Userale) that I am migrating to MV3. I have looked over the Migration guide from FireFox and have followed all of the instructions. I am finally able to load the extension onto FireFox without getting any errors; However, I am not seeing any logs get generated in the console tab in FireFox.

Here is my manifest.json

{
  "manifest_version": 3,
  "name": "UserALE Extension",
  "version": "2.3.0",
  "description": "Injects UserALE.js into every page for testing & user research purposes",
  "icons": {
    "48": "icons/UserALE Logo.png"
  },
  "permissions": [
    "activeTab",
    "storage",
    "tabs",
    "webRequest"
  ],
  "host_permissions": [
    "<all_urls>"
  ],
  "background": {
    "page": "background.html"
  },
  "content_scripts": [
    {
      "matches": [
        "<all_urls>"
      ],
      "js": ["content.js"],
      "all_frames": true
    }
  ],
  "options_ui": {
    "page": "optionsPage.html"
  }
}

and here is my background.html

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <script type="module" src="background.js" persistent="false"></script>
  </head>
</html>

And for testing purposes, I have added this to my background.js

browser.browserAction.onClicked.addListener(async function (tab) {
  console.log("clicked");
});

To my understanding, when I click anywhere on the page, I should get a log generated "Clicked", however nothing happens in the console. Also I would like to note, I have tested this same code with MV2 on FireFox and I get logs generated in the browser console. Manifest V2

{
  "manifest_version": 2,
  "name": "User ALE Extension",
  "version": "2.3.0",
  "description": "Injects UserALE.js into every page for testing & user research purposes",
  "icons": {
    "48": "icons/border-48.png"
  },
  "permissions": [
    "activeTab",
    "storage",
    "tabs",
    "<all_urls>"
  ],
  "background": {
    "scripts": ["background.js"]
  },
  "content_scripts": [
    {
      "matches": [
        "<all_urls>"
      ],
      "js": ["content.js"],
      "all_frames": true
    }
  ],
  "options_ui": {
    "page": "optionsPage.html"
  }
}

Lastly, I know that there is nothing wrong with my content.js and background.js because MV3 runs as expected on Chrome, I just have these issues on FireFox.

Thanks in advance for any help!

aghaemi
  • 11
  • 2
  • Did you use the [correct console](https://stackoverflow.com/q/38913799)? If so, sounds like a bug in Firefox. Its MV3 is still incomplete. Also note that browserAction.onClicked has no relation to clicking the page, it's only about clicking the icon of the extension. – wOxxOm Oct 24 '22 at 21:42

0 Answers0