Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

How to download a webpage using javascript from firefox ?

  • 2 trả lời
  • 1 gặp vấn đề này
  • 1 lượt xem
  • Trả lời mới nhất được viết bởi cor-el

more options

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);
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)

more options

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.

more options

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.