Fix magnet protocol url

fix #87
This commit is contained in:
CzBiX
2021-05-30 16:01:06 +08:00
parent 14792bcb0a
commit 1a216bc2d0

View File

@@ -7,8 +7,10 @@ function registerProtocolHandler() {
return;
}
const baseUrl = location.origin + location.pathname;
try {
navigator.registerProtocolHandler('magnet', location.origin + '#download=%s', document.title);
navigator.registerProtocolHandler('magnet', baseUrl + '#download=%s', document.title);
} catch (e) {
log('Register protocol handler failed.', e);
}