skreborn
skreborn

Reputation: 2221

Error when defining a firefox WebExtensions options page

I am currently working on a rather simple add-on for Firefox using the new WebExtensions API. All is well up until the point I try to define options_ui in the manifest file. When set, loading the extension results in the following error:

There was an error during installation: getURL may not be called before an id or uuid has been set.

Full manifest:

{
  "manifest_version": 2,
  "name": "MyExtension",
  "version": "1.0",
  "description": "...",
  "icons": {
    "48": "icons/48.png",
    "96": "icons/96.png"
  },
  "permissions": [
    "storage",
    "notifications",
    "*://*.example.com/"
  ],
  "browser_action": {
    "default_icon": "icons/32.png",
    "default_title": "MyExtension",
    "default_popup": "popup.html"
  },
  "options_ui": {
    "page": "options.html"
  },
  "background": {
    "scripts": [ "background.js" ]
  }
}

The problem does not occur if options_ui is unset, and the extension works as expected, apart from the missing options page, of course.

What could be the source of this error? Why does it only happen with options_ui? browser_action.default_popup has a URL, too, and that works.

Thanks in advance.

Upvotes: 4

Views: 365

Answers (1)

skreborn
skreborn

Reputation: 2221

This is apparently a known bug. A workaround right now is to set applications.gecko.id manually.

"applications": {
  "gecko": {
    "id": "[email protected]"
  }
}

Upvotes: 6

Related Questions