Skip to content

Commit

Permalink
Check download origin before suggesting new filename in Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
gyng committed Apr 27, 2019
1 parent 0b3cc13 commit 00ca8b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# 3.4.1

* Fix `Referer` header not set in Chrome >= 72 (#66)
* Check if download originates from save-in before renaming download (Chrome, #109)
* Add favicon to options page (#108)

# 3.4.0

Expand Down
15 changes: 11 additions & 4 deletions src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,17 @@ if (chrome && chrome.downloads && chrome.downloads.onDeterminingFilename) {
(globalChromeState.info && globalChromeState.info.suggestedFilename) ||
downloadItem.filename ||
(globalChromeState.info && globalChromeState.info.filename);
suggest({
filename: Download.finalizeFullPath(globalChromeState),
conflictAction: options.conflictAction
});

// Don't interfere with other extensions
if (
browser.runtime &&
browser.runtime.id === downloadItem.byExtensionId
) {
suggest({
filename: Download.finalizeFullPath(globalChromeState),
conflictAction: options.conflictAction
});
}
}
);
}
Expand Down

0 comments on commit 00ca8b8

Please sign in to comment.