Skip to content Skip to sidebar Skip to footer

Referenceerror While Using Sdk/tabs In Firefox Webextension

This is my first time learning to build a firefox addon. I want store all the open tabs in a window and for that I require sdk/tabs. Here is my js file: /* Given the name of a beas

Solution 1:

The error is on package.json line 6: you're telling to the addon sdk that the main file of your addon is manage.json. According to [the docs] the value of main should be:

A string representing the name of a program module that is located in one of the top-level module directories specified bylib. Defaults to"index.js".

So you need to change its value to index.js.

Besides that, I think you're missing a difference between Firefox addon built using the addon-sdk (which do not have a ´manifest.json´ and that you build using jpm tool) and the new WebExtensions which do require you to write a ´manifest.json´ like the one already have.

UPDATE:

Again: you're missing the difference between WebExtensions and SDK-based addons. Now you made a WebExtension but you're trying to use the SDK. It isn't possible. Just use chrome.tabs directly instead of trying to import it from the sdk (var tabs = require("sdk/tabs");).

Post a Comment for "Referenceerror While Using Sdk/tabs In Firefox Webextension"