so im trying to make a firefox addon. (javascript & mozilla's api)
and now iam just stuck
i have read thru
all mozilla sites (almost), all google sites in the topic,code snippets,other addons
but still cant get it to work
so what i want is to get xml content on a remote url. i know this is doable because i have addons that do it "have tried to understand how and why but without any luck"
iam working in
https://builder.addons.mozilla.org/package/153928/latest/i have tried following
XMLHttpRequest (witch is working for the addon i have looked at)
downloading the page to temp
opening new tab/window/iframe and read source from it
i have tried over 100 different combinations both javascript and mozillas api.
the best luck i have had is with mozillas api "page-worker" witch will logg the source to console. so iam getting somewhere...
now the thing i need to do is to call the function when i click but every time i try to implement the code within the click code i get "var tabs = require("tabs"); ReferenceError: require is not defined" this happens with all require codes ill try. its probably something easy as declaring it but i really cant figure it out and i havent worked in javascript so much
the click code:
self.on("click", function (node, data) {
var tabs = require("tabs");
tabs.open("http://www.example.com");
});
heres a test project
https://builder.addons.mozilla.org/package/153928/latest/i would really appreciate if someone could guide me in the right direction on this
iam not asking you to solve it for me just push me in the right direction and using tabs would without the window.open("
http://some.site"); but with the api would get me where i need to be
and yeah sry for my bad language but i cba to do anything about it atm. iam just in that bad of a mood.
Thanks for taking the time and reading this
Edit: LOL i think all i needed was to write something other the code because i just figured out to use the onMessage: function and now i can open a new tab with the api >.< thanx evilzone ^^