THE LINE IN THE CODE WITH ERROR :
var dir =Components.classes["@mozilla.org/file/local;1"]
Additional System Details
- User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
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.