且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在同一页面而不是弹出窗口中打开Chrome应用程序?

更新时间:2023-11-22 17:35:52

似乎您将chrome扩展名与chrome应用程序混淆了.

It seems that you are confusing chrome extensions with chrome apps.

您无法尝试在chrome打包的应用程序中执行任何操作,清单文件似乎是CPA而不是扩展程序所需的文件.甚至更多,您正在使用background.js脚本,该脚本将打开一个新的chrome应用程序窗口,其中包含demo.html页面.

What you are trying to do is not possible in a chrome packaged app, your manifest file seems to be the one you need for a CPA not for an extension. Even more, you are using a background.js script that will open a new chrome app window with the demo.html page in it.

如果您指的是chrome扩展程序,则可能需要将问题标记为 google-chrome-extension .

If you are refering to a chrome extension then you might want to tag your question as google-chrome-extension.

如果没有,那么答案很简单:无法在chrome打包的应用中打开标签页,chrome浏览器标签页的概念不适用.

If not, then the answer is easy: It is not possible to open tabs in chrome packaged apps, the concept of a chrome browser tab doesn't apply.