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 } })