【发布时间】:2019-12-02 21:02:58
【问题描述】:
我的前端有一个带有不同按钮的页面,所有按钮都可以正常工作,但是如果我单击在 chrome 网上商店中打开扩展程序的按钮,然后单击另一个按钮,则页面不会'不打开。
这是我所说的一个例子。如果您在未关闭正在打开的选项卡的情况下单击按钮,则在 chrome 网上商店打开后单击的按钮将不起作用。 有谁知道这是为什么以及如何解决这个问题?
https://html-ichr7r.stackblitz.io
这是它的代码。
<button id="button1" onclick="window.open('https://www.facebook.com/','popup','width=700,height=300');"><strong>CONTINUAR</strong></button><br>
<button id="button2" onclick="window.open('https://www.google.com/','popup','width=700,height=300');"><strong>CONTINUAR</strong></button>
<button id="button3" onclick="window.open('https://chrome.google.com/webstore/detail/dark-mode/dmghijelimhndkbmpgbldicpogfkceaj?hl=de','popup','width=700,height=300');"><strong>CONTINUAR</strong></button><br>
<button id="button4" onclick="window.open('https://www.9gag.com/','popup','width=700,height=300');"><strong>CONTINUAR</strong></button>
感谢任何帮助!
编辑:我刚刚发现它可以在 Firefox 中运行,但仍然不知道为什么它不能在 Chrome 中运行。
【问题讨论】:
-
这很奇怪。我能想到的只是chrome必须出于某种原因劫持窗口对象。如果你不能解决它,也许你应该在铬上创建一张票
标签: javascript html google-chrome