mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -06: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:
@@ -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 = '';
|
||||
|
||||
Reference in New Issue
Block a user