How do I display a link in a panel on my Firefox Extension using the Add-on SDK? -
i'm making firefox extension using add-on sdk (widget).
what i'm trying upon widget being clicked is: identify addresses on webpage, highlight addresses, , show panel (attached widget) links google maps address.
the issue having displaying link in panel. have been able open , display actual sites , html files in panel, know how, if possible, display clickable link in panel.
i have been on panel api , have not discovered way.
any tips appreciated. thank you.
edit: using add-on sdk version 1.13.2
you can use local file myfile.html
placed in data
directory. file can receive port message show in onclick
function of widget.
var panel = require("sdk/panel").panel({ contenturl: require("sdk/self").data.url("myfile.html"); }); require("sdk/widget").widget({ id: "addrs", label: "addresses", contenturl: "https://maps.gstatic.com/favicon3.ico", panel: panel, onclick: function() { panel.port.emit('addrs', arrayofaddresses); } });
read getting user input section of panel docs more info on structure of files , code myfile.html.
Comments
Post a Comment