Last active
August 29, 2015 14:08
-
-
Save Qofar/7057243f974b03a6898e to your computer and use it in GitHub Desktop.
chrome.downloads.onDeterminingFilenameを使うと最後に保存したフォルダを記憶してくれなくなるがfilenameに絶対パスを指定することでエラーを起こし無理やり機能させる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrome.downloads.onChanged.addListener(function(downloadDelta) { | |
if (downloadDelta.state && downloadDelta.state.current === "complete") { | |
var id = downloadDelta.id; | |
setTimeout(function(){ | |
chrome.downloads.erase({id: id}); | |
}, 5000); | |
} | |
}); | |
chrome.downloads.onDeterminingFilename.addListener(function(downloadItem, suggest) { | |
var dir = "C:\\"; | |
suggest({filename: dir + downloadItem.filename, conflictAction: "prompt"}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"background": { | |
"persistent": false, | |
"scripts": [ "background.js" ] | |
}, | |
"description": "FilenameConflictAction prompt. AND auto-hide download bar.", | |
"manifest_version": 2, | |
"name": "DownloadPlus", | |
"permissions": [ "downloads" ], | |
"version": "1.0" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment