How to download a webpage using javascript from firefox ?
I've been developing an add-on for firefox where I needed to download the webpages that I visit and store it locally. How should I do this ? I've been trying with javascript but there seems to be no proper reference. I googled and found a sample code but this shows error that "Component.classes" is undefined. So can I actually do it with javascript ?
THE LINE IN THE CODE WITH ERROR :
var dir =Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
Tất cả các câu trả lời (2)
Hi, make a folder on your system for each site and go tot the site and Right Click and Save Page as ot give this a try : http://www.httrack.com/ Note if the site has safe guards up it will not matter what you use and you can not gain access.
You can't use XUL code in a WebExtension, you can only use API calls.
Try to ask advice at the Add-ons forum, that forum is better suited for questions about developing extensions.