Skip to content

A full-featured download manager.

fix: open app with resource url

Dr_rOot3ee98eae1d1c
diff --git a/src/main/core/ProtocolManager.js b/src/main/core/ProtocolManager.js
index cfce2474..59904451 100644
--- a/src/main/core/ProtocolManager.js
+++ b/src/main/core/ProtocolManager.js
@@ -44,10 +44,13 @@ export default class ProtocolManager extends EventEmitter {
logger.info(`[Motrix] protocol url: ${url}`)
if (
+ url.toLowerCase().startsWith('ftp:') ||
+ url.toLowerCase().startsWith('http:') ||
+ url.toLowerCase().startsWith('https:') ||
url.toLowerCase().startsWith('magnet:') ||
url.toLowerCase().startsWith('thunder:')
) {
- return this.handleMagnetAndThunderProtocol(url)
+ return this.handleResourceProtocol(url)
}
if (
@@ -58,7 +61,7 @@ export default class ProtocolManager extends EventEmitter {
}
}
- handleMagnetAndThunderProtocol (url) {
+ handleResourceProtocol (url) {
if (!url) {
return
}
diff --git a/src/main/utils/index.js b/src/main/utils/index.js
index 652b6617..c304951f 100644
--- a/src/main/utils/index.js
+++ b/src/main/utils/index.js
@@ -102,13 +102,13 @@ export function parseArgvAsUrl (argv) {
export function checkIsSupportedSchema (url = '') {
const str = url.toLowerCase()
if (
- str.startsWith('mo:') ||
- str.startsWith('motrix:') ||
+ str.startsWith('ftp:') ||
str.startsWith('http:') ||
str.startsWith('https:') ||
- str.startsWith('ftp:') ||
str.startsWith('magnet:') ||
- str.startsWith('thunder:')
+ str.startsWith('thunder:') ||
+ str.startsWith('mo:') ||
+ str.startsWith('motrix:')
) {
return true
} else {