From 8a24377dfac808666b3cce048fe57e1467b0879b Mon Sep 17 00:00:00 2001 From: thomasjm Date: Fri, 9 Aug 2024 01:39:46 -0700 Subject: [PATCH] Set firefox saveToDisk mime types instead of * --- .../WebDriver/Internal/Capabilities/Extra.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sandwich-webdriver/src/Test/Sandwich/WebDriver/Internal/Capabilities/Extra.hs b/sandwich-webdriver/src/Test/Sandwich/WebDriver/Internal/Capabilities/Extra.hs index 086c6234..37259549 100644 --- a/sandwich-webdriver/src/Test/Sandwich/WebDriver/Internal/Capabilities/Extra.hs +++ b/sandwich-webdriver/src/Test/Sandwich/WebDriver/Internal/Capabilities/Extra.hs @@ -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 } })