Skip to content

Commit 2263959

Browse files
committedMay 1, 2021
Removed firefox workaround
1 parent d311ebb commit 2263959

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ node_modules/
1010
InstagramDownloader.zip
1111
.idea/*.iws
1212
*.iws
13+
tmp.json

‎src/ts/background/download.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,11 @@ export async function downloadSingleImage(message: DownloadMessage): Promise<voi
1616
let imageName = getImageId(message.imageURL[0]);
1717
imageName = `${message.accountName}_${imageName}`;
1818

19-
const headers = [];
20-
// Check if the user uses firefox
21-
if ((window as unknown as { browser: object }).browser) headers.push({name: 'Referer', value: 'https://www.instagram.com/'});
22-
19+
const file = await (await fetch(message.imageURL[0])).blob();
2320
await browser.downloads.download({
24-
url: message.imageURL[0],
21+
url: URL.createObjectURL(file),
2522
filename: imageName,
26-
headers,
2723
});
28-
2924
}
3025

3126
export function downloadBulk(urls: string[], accountName: string): void {

0 commit comments

Comments
 (0)