fix: stealth thing

This commit is contained in:
orion 2023-10-03 17:59:53 -05:00
parent 70ec5f5273
commit 3f2a4447a8
Signed by: orion
GPG Key ID: 6D4165AE4C928719
3 changed files with 11 additions and 5 deletions

View File

@ -2,4 +2,4 @@ import { PuppeteerExtra } from 'puppeteer-extra'
import Stealth from 'puppeteer-extra-plugin-stealth' import Stealth from 'puppeteer-extra-plugin-stealth'
/** @type {(_: PuppeteerExtra) => () => PuppeteerExtra} */ /** @type {(_: PuppeteerExtra) => () => PuppeteerExtra} */
export const install = p => () => p.use(Stealth()) export const install = p => () => p.use(Stealth({}))

View File

@ -18,7 +18,7 @@ import Prelude
import Control.Promise (Promise) import Control.Promise (Promise)
import Control.Promise as Promise import Control.Promise as Promise
import Data.Map (Map) import Data.Map (Map)
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..), fromMaybe)
import Effect (Effect) import Effect (Effect)
import Effect.Aff (Aff) import Effect.Aff (Aff)
import Effect.Unsafe (unsafePerformEffect) import Effect.Unsafe (unsafePerformEffect)
@ -151,7 +151,7 @@ prepareLaunchOptions
, handleSIGHUP: FFI.maybeToUndefined handleSIGHUP , handleSIGHUP: FFI.maybeToUndefined handleSIGHUP
, handleSIGINT: FFI.maybeToUndefined handleSIGINT , handleSIGINT: FFI.maybeToUndefined handleSIGINT
, handleSIGTERM: FFI.maybeToUndefined handleSIGTERM , handleSIGTERM: FFI.maybeToUndefined handleSIGTERM
, args: FFI.maybeToUndefined args , args: fromMaybe [] args
, debuggingPort: FFI.maybeToUndefined debuggingPort , debuggingPort: FFI.maybeToUndefined debuggingPort
, devtools: FFI.maybeToUndefined devtools , devtools: FFI.maybeToUndefined devtools
, headless: if headless then writeImpl "new" else writeImpl false , headless: if headless then writeImpl "new" else writeImpl false

View File

@ -92,8 +92,14 @@ spec = describe "Plugin" do
describe "Stealth" do describe "Stealth" do
test "install" do test "install" do
pup <- Pup.new 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 describe "AnonymousUserAgent" do
test "install" do test "install" do
pup <- Pup.new 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