Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL not working with plugin-stealth #136

Closed
xiadongdev opened this issue Jan 9, 2020 · 7 comments
Closed

URL not working with plugin-stealth #136

xiadongdev opened this issue Jan 9, 2020 · 7 comments

Comments

@xiadongdev
Copy link

This URL https://www.rogers.com/web/consumer/ignite-bundles/get-iptv works fine when not using plugin-stealth, but doesn't work with the plugin:

import puppeteer from "puppeteer-extra";
import pluginStealth from "puppeteer-extra-plugin-stealth";

puppeteer.use(pluginStealth());
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto('https://www.rogers.com/web/consumer/ignite-bundles/get-iptv')
await page.screenshot({
    path: 'full.png',
    fullPage: true
})
await browser.close()

The error is:
JS page error on website https://www.rogers.com/web/consumer/ignite-bundles/get-iptv = Error: TypeError: Illegal invocation

@Niek
Copy link
Collaborator

Niek commented Jan 10, 2020

This was fixed in #130 (released as 2.4.9), are you sure you have the latest version?

@xiadongdev
Copy link
Author

The new release works, thanks Niek!

@xiadongdev
Copy link
Author

I have to reopen this issue because the newest version doesn't work with the following sites:
cnn.com, and wsj.com

For example, cnn.com should look like this:
Screen Shot 2020-01-10 at 3 45 54 PM

But when using the plugin, it looks like this (only an ad on a blank page):
Screen Shot 2020-01-10 at 3 46 57 PM

And the error was Error: SyntaxError: Unexpected token ','

Thank you in advance for looking into this!

@xiadongdev xiadongdev reopened this Jan 10, 2020
@Niek
Copy link
Collaborator

Niek commented Jan 13, 2020

That's the same issue as #137 - disabling iframe.contentWindow evasion helps for now.

@xiadongdev
Copy link
Author

That's the same issue as #137 - disabling iframe.contentWindow evasion helps for now.

Hi Niek, thank you for your help. I've tried

puppeteer.use(pluginStealth());
pluginStealth.enabledEvasions.delete("iframe.contentWindow")

But it produced an error:
Property 'enabledEvasions' does not exist on type '(opts?: { enabledEvasions?: Set<string>; }) => StealthPlugin'.

I'm using typescript, and I couldn't find docs on this, not sure how should I fix this?

@Niek
Copy link
Collaborator

Niek commented Jan 13, 2020

You need to do something like:

let ps = pluginStealth();
ps.enabledEvasions.delete('iframe.contentWindow');
puppeteer.use(ps);

@xiadongdev
Copy link
Author

Thanks Niek, this solution works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants