diff --git a/src/Puppeteer.Plugin.Stealth.js b/src/Puppeteer.Plugin.Stealth.js index 6056ed8..a571a65 100644 --- a/src/Puppeteer.Plugin.Stealth.js +++ b/src/Puppeteer.Plugin.Stealth.js @@ -2,4 +2,4 @@ import { PuppeteerExtra } from 'puppeteer-extra' import Stealth from 'puppeteer-extra-plugin-stealth' /** @type {(_: PuppeteerExtra) => () => PuppeteerExtra} */ -export const install = p => () => p.use(Stealth()) +export const install = p => () => p.use(Stealth({})) diff --git a/src/Puppeteer.purs b/src/Puppeteer.purs index fde2767..33f980c 100644 --- a/src/Puppeteer.purs +++ b/src/Puppeteer.purs @@ -18,7 +18,7 @@ import Prelude import Control.Promise (Promise) import Control.Promise as Promise import Data.Map (Map) -import Data.Maybe (Maybe(..)) +import Data.Maybe (Maybe(..), fromMaybe) import Effect (Effect) import Effect.Aff (Aff) import Effect.Unsafe (unsafePerformEffect) @@ -151,7 +151,7 @@ prepareLaunchOptions , handleSIGHUP: FFI.maybeToUndefined handleSIGHUP , handleSIGINT: FFI.maybeToUndefined handleSIGINT , handleSIGTERM: FFI.maybeToUndefined handleSIGTERM - , args: FFI.maybeToUndefined args + , args: fromMaybe [] args , debuggingPort: FFI.maybeToUndefined debuggingPort , devtools: FFI.maybeToUndefined devtools , headless: if headless then writeImpl "new" else writeImpl false diff --git a/test/Puppeteer.Plugin.Spec.purs b/test/Puppeteer.Plugin.Spec.purs index 3d22857..95f1562 100644 --- a/test/Puppeteer.Plugin.Spec.purs +++ b/test/Puppeteer.Plugin.Spec.purs @@ -92,8 +92,14 @@ spec = describe "Plugin" do describe "Stealth" do test "install" do pup <- Pup.new - void $ liftEffect $ Pup.Stealth.install pup + pup' <- liftEffect $ Pup.Stealth.install pup + b <- Pup.launch_ pup' + p <- Pup.Page.new b + pure unit describe "AnonymousUserAgent" do test "install" do pup <- Pup.new - void $ liftEffect $ Pup.AnonUA.install pup + pup' <- liftEffect $ Pup.AnonUA.install pup + b <- Pup.launch_ pup' + p <- Pup.Page.new b + pure unit