Firefox ToolBar Button When Click Changes DOM? -
new firefox development , trying best figure out.
say want call function in tap_browser.js modify dom when user clicks on toolbar widget, how this?
this code have far
require("toolbarwidget").toolbarwidget({ toolbarid: "nav-bar", // <-- place widget on navigation bar id: "tap-icon", label: "tap", contenturl: data.url("favicon.png"), contentscriptfile: [data.url("tap_browser.js")] });
i'm using library create toolbar widget here: https://github.com/rob--w/toolbarwidget-jplib
i don't know sdk helped does. check out:
var my_wid = widgets.widget({ id: "my-widget", label: "cliiiick", content: "click me", width: 100, onclick: function() { require('sdk/window/utils').getmostrecentbrowserwindow().gbrowser.contentdocument.documentelement.innerhtml = 'hi'; } });
what shows panel 0 width , height, can put stuff in there, , when shows executes onshow function change html of current document. not recommended use innerhtml, addons arent accepted. im showing quick , dirty copy paste example. 1 different sdk doc page "modifying page hosted tab"
Comments
Post a Comment