Skip to content

Commit

Permalink
Fix magnet protocol url
Browse files Browse the repository at this point in the history
fix #87
  • Loading branch information
CzBiX committed May 30, 2021
1 parent 14792bc commit 1a216bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/protocolHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1a216bc

Please sign in to comment.