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

Can't block javascript-based download #22

Open
avimar opened this issue Feb 16, 2018 · 0 comments
Open

Can't block javascript-based download #22

avimar opened this issue Feb 16, 2018 · 0 comments

Comments

@avimar
Copy link

avimar commented Feb 16, 2018

I originally had nightmare-load-filter blocking the URL that I didn't want to open, but my script was still hanging -- I see a download link opens up.

So I added nightmare-download-manager and set ignoreDownloads: true in the Nightmare setup but that didn't help. Apparently I tried this a while ago... segment-boneyard/nightmare#1071

The window opens from this code:
<script>window.open('SomePage.aspx?ID=1234');</script>

It seems this isn't getting caught by the filter or download manager. Doing an evaluate to remove the script doesn't always catch it before it executes.

I even tried clobbering the window.open using this code: if(typeof window.open === 'function') window.open=null; in my wait, but that didn't seem to help.

Any suggestions?

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

1 participant