Skip to content

Commit

Permalink
add support of webtor extension 0.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
vintikzzz committed Feb 8, 2025
1 parent f7d6177 commit 3af8707
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 42 deletions.
5 changes: 5 additions & 0 deletions assets/src/js/app/ext/download.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {makeDebug} from '../../lib/debug';
import semver from 'semver'
const debug = await makeDebug('webtor:ext');

function init() {
Expand All @@ -22,6 +23,10 @@ function fetch(downloadId) {
return;
}
if (event.data.torrent) {
if (event.data.ver && semver.gte('0.1.12', event.data.ver)) {
resolve(new Blob([new Uint8Array(event.data.torrent)]));
return;
}
resolve(new Blob([new Uint8Array(event.data.torrent.data)]));
}
});
Expand Down
109 changes: 67 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"postcss-loader": "^8.1.1",
"postcss-nesting": "^13.0.1",
"postcss-preset-env": "^10.1.3",
"semver": "^7.7.1",
"sha1": "^1.1.1",
"style-loader": "^4.0.0",
"stylelint": "^16.13.2",
Expand Down

0 comments on commit 3af8707

Please sign in to comment.