简体   繁体   English

如何通过Chrome扩展程序显示“文件另存为”对话框?

[英]How do I show a File Saveas dialog from a Chrome Extension?

I'm creating an extension for Google Chrome that converts a webpage into a PDF file. 我正在为Google Chrome创建一个扩展程序,该扩展程序可以将网页转换为PDF文件。 From the JavaScript background page, the URL, DOM, and the path are passed to the NPAPI DLL, where the conversion happens. URL,DOM和路径从JavaScript后台页面传递到进行转换的NPAPI DLL。 For now, the path is hard-coded. 目前,该路径是硬编码的。 I want to add a File Saveas dialog to the extension, and grab the path from it, with the file name, and pass it to the NPAPI DLL. 我想将File Saveas对话框添加到扩展名,并使用文件名从中获取路径,并将其传递给NPAPI DLL。 What should I do? 我该怎么办?

Why would you do the file save-as dialog in the extension if you are just going to have it pass to the NPAPI dll? 如果仅要将文件传递为NPAPI dll,为什么还要在扩展名中执行文件另存为对话框? If it were me I'd just have the NPAPI dll pop up the save dialog. 如果是我,我只会让NPAPI dll弹出保存对话框。

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

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