Skip to content

Commit

Permalink
Set firefox saveToDisk mime types instead of *
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Aug 9, 2024
1 parent c050020 commit 8a24377
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,21 @@ configureDownloadCapabilities downloadDir caps@(W.Capabilities {W.browser=browse
Nothing -> return ()
Just _ -> liftIO $ throwIO $ userError [i|Can't support Firefox profile yet.|]

let saveToDiskMimeTypes = [
"application/gzip"
, "application/x-gzip"
, "application/x-gtar"
, "application/x-tgz"

, "application/pdf"
, "application/zip"
]

profile <- liftIO $ FF.defaultProfile
& FF.addPref "browser.download.folderList" (2 :: Int)
& FF.addPref "browser.download.manager.showWhenStarting" False
& FF.addPref "browser.download.dir" downloadDir
& FF.addPref "browser.helperApps.neverAsk.saveToDisk" ("*" :: String)
& FF.addPref "browser.helperApps.neverAsk.saveToDisk" (T.unpack (T.intercalate "," saveToDiskMimeTypes))
& FF.prepareProfile

return (caps { W.browser = browser { W.ffProfile = Just profile } })
Expand Down

0 comments on commit 8a24377

Please sign in to comment.