Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法通过使用我的扩展代码中的(已经注册的)URI 方案来启动应用程序?
我想通过 background.js 监控一些东西并通过 URI 方案自动启动一个应用程序
您可以通过将一个附加iframe到您的背景页面来做到这一点。
iframe
再次以 Steam 示例为例:
var frame = document.createElement("iframe"); frame.src = "steam://open/main"; // Needs to be inserted into document to trigger load document.body.appendChild(frame); document.body.removeChild(frame);