Skip to content

Commit 12a5372

Browse files
committed
Download without DM
1 parent c778c99 commit 12a5372

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

background.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,18 @@ browser.runtime.onMessage.addListener((request, sender, callback) => {
216216
load_conf ();
217217
} else if (request.extensionId == "gdmurl") {
218218
if (!InterruptDownloads || ResponGdm) {
219+
downloadfirefox (request.message);
219220
return;
220221
}
221222
fetch (get_host (), { method: 'post', body: request.message }).then (function (r) { return r.text (); }).catch (function () {});
222223
}
223224
});
224225

226+
async function downloadfirefox (urls) {
227+
let url = urls.substring (5, urls.lastIndexOf(",filename:"));
228+
await browser.downloads.download({url: url});
229+
}
230+
225231
get_host = function () {
226232
if (CustomPort) {
227233
return `http://127.0.0.1:${PortSet}`;

0 commit comments

Comments
 (0)