[英]Firefox window.open(“about:blank”) doesn't open blank tab
[英]window.open(url, target) doesn't activate a tab in Firefox
這個簡單的代碼:
<button onclick="window.open('https://google.com', 'my-tab')">open google</button>
在 Chrome 中運行良好,但在 Firefox(最新 v75)中它始終打開,但僅在第一次激活新選項卡。
與步驟 2 相同的選項卡被打開並激活(可見)
與步驟 2 相同的選項卡已打開但未激活(不可見)
這是 Firefox 中的錯誤還是我遺漏了什么?
在這里試試這個:
<button onclick="window.open('https://google.com', 'my-tab').focus()">open google</button>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.