简体   繁体   中英

How use Scripting.FileSystemObject in Microsoft Edge

I know that ActiveXObject is no longer in Microsoft Edge. So how can i use the FileSystemObject in Microsoft Edge? I'm trying to make a Microsoft Edge plugin that obtains the html code of a page web and writes it into a .txt in my local file system The following code is this:

browser.browserAction.onClicked.addListener(function(tab) {
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f1 = fso.CreateTextFile("C:\\Users\\lucas\\Desktop\\htmltext.txt",true);
var markup = document.documentElement.outerHTML;
f1.WriteLine(markup);
f1.Close();});

ActiveX is not supported in Microsoft Edge, and Microsoft Edge doesn't support plugin either.

You could consider write an extension for Microsoft Edge, use Native Messaging to pass html code from extension to your native app, then write the info into file system from native app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM