mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Move registering WebUI magnet handler behind toolbar option
Alert the user if the operation fails due to lack of browser support
This commit is contained in:
parent
b9da9ebfdf
commit
324d20d42c
2 changed files with 8 additions and 3 deletions
|
@ -590,6 +590,10 @@ window.addEvent('load', function() {
|
|||
MochaUI.Desktop.setDesktopSize();
|
||||
});
|
||||
|
||||
$('registerMagnetHandlerLink').addEvent('click', function(e) {
|
||||
registerMagnetHandler();
|
||||
});
|
||||
|
||||
$('speedInBrowserTitleBarLink').addEvent('click', function(e) {
|
||||
speedInTitle = !speedInTitle;
|
||||
localStorage.setItem('speed_in_browser_title_bar', speedInTitle.toString());
|
||||
|
@ -801,13 +805,13 @@ window.addEvent('load', function() {
|
|||
addMainWindowTabsEventListener();
|
||||
addSearchPanel();
|
||||
}
|
||||
|
||||
registerMagnetHandler();
|
||||
});
|
||||
|
||||
function registerMagnetHandler() {
|
||||
if (typeof navigator.registerProtocolHandler !== 'function')
|
||||
if (typeof navigator.registerProtocolHandler !== 'function') {
|
||||
alert("Your browser does not support this feature");
|
||||
return;
|
||||
}
|
||||
|
||||
const hashParams = getHashParamsFromUrl();
|
||||
hashParams.download = '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue