Open magnet link without losing focus

2019-07-03 19:00发布

Is there a way in javascript (or other) to handle a magnet link without the browser losing the focus? It'd be a little like opening a tab in the background without leaving the current page.

2条回答
我欲成王,谁敢阻挡
2楼-- · 2019-07-03 19:37

I recently had a similar problem, and was able to solve it by creating a named frame on the page and using it as the target for window.open:

<iframe style="display:none" name="magnetframe"></iframe>

window.open(magnet_uri, 'magnetframe')
查看更多
一夜七次
3楼-- · 2019-07-03 19:47

another solution by using chrome API.

chrome.tabs.update({url: magnet_uri});

查看更多
登录 后发表回答