How to access panel document in Firefox extension (after calling webservice)? -


i defined html filed content of panel, in data folder.

var popuppanel = require("sdk/panel").panel({   contenturl: data.url("main.html") }); 

i'm trying access dom of document, javascript, in lib folder. seems not possible, since document variable undefined.

then followed 1 of sample add ons, there's html , javascript in data folder, , javascript accesses dom of html. tried follow example, differently in sample, have call webservice, , modify dom using response. found can't call webservices javascripts stored in data folder.

i read implementing communication between files in lib , data folder - simple use case , hope there's simpler solution, like, putting workflow in single js file :d (in chrome it's possible!).

note: i'm not asking how call webservice, got working. problem how do + access dom on response.

any ideas? in advance.

to quote the sdk panel documentation:

you can't directly access panel's content main add-on code. access panel's content, need load script panel. in sdk these scripts called "content scripts" because they're explicitly used interacting web content.

while content scripts can access content they're attached to, can't use sdk's apis. so implementing complete solution means have send messages between content script , main add-on code.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -