[英]How to move tab to a new window in a browser extension
The following is not working all the time, just sometimes:以下内容并非一直有效,只是有时:
let win = await browser.windows.create()
await browser.tabs.move(tab.id, {index: 0, windowId: win.id})
I'm not sure if it's a problem with how I'm using the api.我不确定我使用 api 的方式是否有问题。
I checked some github repo and found they do this:我检查了一些 github 回购协议,发现他们这样做:
browser.tabs.create({active: true, url: tab.url})
That actually works.这确实有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.