【发布时间】:2016-01-28 00:06:42
【问题描述】:
我正在尝试使用 node-webkit 制作类似 pdf 下载器的东西。 我有一个带有一些验证代码的 URL 输入标签。 到目前为止它工作得很好..但是当我尝试像这样放置 URL 时 (铬扩展://oemmndcbldboiebfnladdacbdfmadadm/http://www.semantikon.com/StealThisBookbyAbbieHoffman.pdf) node web-kit 给了我这个错误:
message: "Protocol "chrome-extension:" not supported. Expected "http:"."
我正在使用这个正则表达式
/(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?\.pdf$/gi;
谢谢
【问题讨论】:
-
我知道这是因为“chrome extension://oemmndcbldboiebfnladdacbdfmadadm/”,但也许这个应用程序的用户不知道..所以我该如何解决它..或删除它而不影响 pdf 文件下载。
标签: javascript regex node.js google-chrome node-webkit