简体   繁体   English

如何在Microsoft Edge中使用Scripting.FileSystemObject

[英]How use Scripting.FileSystemObject in Microsoft Edge

I know that ActiveXObject is no longer in Microsoft Edge. 我知道ActiveXObject不再位于Microsoft Edge中。 So how can i use the FileSystemObject in Microsoft Edge? 那么,如何在Microsoft Edge中使用FileSystemObject? 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: 我正在尝试制作一个Microsoft Edge插件,该插件可获取页面Web的html代码并将其写入本地文件系统中的.txt中。以下代码是这样的:

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. Microsoft Edge不支持ActiveX,Microsoft Edge也不支持插件。

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. 您可以考虑为Microsoft Edge编写扩展,使用本机消息传递将扩展中的html代码传递到您的本机应用程序,然后将信息从本机应用程序写入文件系统。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ActiveXObject(“ Scripting.FileSystemObject”)对我不起作用 - ActiveXObject(“Scripting.FileSystemObject”) not working for me 在JavaScript中使用scripting.filesystemobject并检查锁定的文件 - Using scripting.filesystemobject in javascript and checking for locked files 如果用户对新的ActiveXObject(“Scripting.FileSystemObject”)回答“否”,在代码中看到了什么? - What is seen in the code if the user answers No to new ActiveXObject(“Scripting.FileSystemObject”)? Scripting.FilesystemObject filemove,writefile在IE浏览器中无法通过javascript工作(替代方法,doc?) - Scripting.Filesystemobject filemove, writefile not working from javascript in IE browser (workarounds, doc?) 如何在 Microsoft Edge 44 或更早版本中使用 polyfills? - How to use polyfills in Microsoft Edge 44 or earlier? 如何使用Temasys AdapterJS与Microsoft Edge一起使用? - How to use the Temasys AdapterJS to work with Microsoft Edge? 如何在Microsoft Edge中使用Bootstrap Datepicker - How to use Bootstrap Datepicker with Microsoft Edge 如何使用FileSystemObject在JavaScript中读取文件 - How to use FileSystemObject to read file in JavaScript 具有Microsoft Edge的Windows 10应用中的内联脚本问题 - Inline Scripting issue in windows 10 apps with Microsoft edge 如何在带有 Crome 或 Microsoft Edge 的本地计算机上使用 localStorage - How to use localStorage on a local machine with Crome or Microsoft Edge
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM