kfix / MacPin

a webapp container & site specific browser made from WebKit.swift and JavaScriptCore
GNU General Public License v3.0
334 stars 28 forks source link

Default download location? #35

Open mdbraber opened 4 years ago

mdbraber commented 4 years ago

Is is possible to skip the Download dialog and directly download files to a default location?

kfix commented 3 years ago

anything's possible, I guess!

there's an NSSavePanel that's created by this function in modules/MacPin/_macos/WebViewDelegatesOSX.swift:

extension WebViewControllerOSX { // _WKDownloadDelegate
    override func _download(_ download: _WKDownload!, decideDestinationWithSuggestedFilename filename: String!, allowOverwrite: UnsafeMutablePointer<ObjCBool>) -> String! {

Perhaps that modal could be skipped if NSUserDefaults has some kind of special key saved for a download location.

TBH I'm not inclined to add that shortcut as I don't really use MacPin as a daily driver that much and rarely download files with it.