简体   繁体   English

Chrome扩展程序开发-打开文件夹

[英]Chrome extension development - open folder

I am developing a chrome extension for company internal use, what i want to do is open folder in explorer (design folder at internal server) when someone add the project id in a textbox and click the button, 我正在开发供公司内部使用的chrome扩展程序,我想要做的是当有人在文本框中添加项目ID并点击按钮时,在资源管理器中打开文件夹(内部服务器的设计文件夹),

ex: 例如:

'Y:\\design\\' + siteNumber 'Y:\\ design \\'+ siteNumber

Can i do it using javascript? 我可以使用javascript吗?

Thanks! 谢谢! Nalinda 纳林达

否,javascript无法访问本地计算机的文件/文件夹。

Sort of. 有点。 You would need to write a stand-alone application in a native language (like C++ or Java) that could execute the opening of the folder, then have the Chrome extension communicate with it through the NPAPI Plugin . 您可能需要使用本机语言(例如C ++或Java)编写一个独立的应用程序,该应用程序可以执行文件夹的打开操作,然后让Chrome扩展程序通过NPAPI Plugin与之通信。 You could keep it all in Javascript by creating a Node.js program that executes the open /path/to/folder command (or your OS's equivalent). 可以通过创建执行open /path/to/folder命令(或操作系统的等效命令)的Node.js程序,将其全部保留在Javascript中。 Either way, that native program would have to be pre-installed on the user's machine. 无论哪种方式,都必须将本机程序预先安装在用户的计算机上。 But this doesn't seem like it should be a problem if it is an internal project. 但是,如果这是一个内部项目,这似乎应该不是问题。

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

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