簡體   English   中英

打開磁鐵鏈接而不會失去焦點

[英]Open magnet link without losing focus

有沒有一種方法在javascript(或其他)處理磁鐵鏈接,而瀏覽器沒有失去焦點? 這有點像在后台打開標簽而不離開當前頁面。

我最近遇到了類似的問題,並且能夠通過在頁面上創建一個命名框架並將其用作window.open的目標來解決它:

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

window.open(magnet_uri, 'magnetframe')

使用chrome API的另一種解決方案。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM