Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I Getting error on panel's content script of Firefox Addon SDK?

Getting the following error, even after making the script empty I go this error.

console.error: my-addon:
  Message: SyntaxError: expected expression, got end of script

Panel code of my addon:

var { ToggleButton } = require('sdk/ui/button/toggle');
var panels = require("sdk/panel");
var self = require("sdk/self");
var ss = require("sdk/simple-storage");

var button = ToggleButton({
    id: "my-addon",
    label: "My Addon",
    icon: {
        "16": "./img/16-16.png",
        "32": "./img/32-32.png",
        "64": "./img/64-64.png"
    },
    onChange: handleChange
});

var panel = panels.Panel({
    contentURL: self.data.url("popup.html"),
    contentScript: self.data.url("js/pop_listener.js"),
    onHide: handleHide,
    width: 300,
    height: 550
});
like image 767
Alex Avatar asked Dec 13 '14 06:12

Alex


1 Answers

Use contentScriptFile instead of contentScript

like image 129
Touhid Avatar answered Sep 22 '22 10:09

Touhid