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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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')
回答2:
another solution by using chrome API.
chrome.tabs.update({url: magnet_uri});