How To Load Multiple Urls In Pageworker For Firefox Add-on Sdk?
Using the following example, I can get First paragraph from one URL i.e, ContentURL. ex - http://www.example.com //main.js var getFirstParagraph = 'var paras = document.getElement
Solution 1:
Finally, I've ended up the code like this. It's working good.
var getFirstParagraph = "var paras = document.getElementsByTagName('p');" +
"console.log(paras[0].textContent);"var urls = ["http://www.example.com", "http://www.example2.com"];
for(var i=0; i<urls.length; i++)
{
pageWorker = require("sdk/page-worker").Page({
contentScript: getFirstParagraph,
contentURL : urls[i],
});
}
I didn't find any better option than this. Hope this helps someone.
Post a Comment for "How To Load Multiple Urls In Pageworker For Firefox Add-on Sdk?"