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

Option to disable loading of frames #665

Closed
royteeuwen opened this issue Nov 15, 2023 · 5 comments
Closed

Option to disable loading of frames #665

royteeuwen opened this issue Nov 15, 2023 · 5 comments

Comments

@royteeuwen
Copy link

We use HTMLUnit as a test engine to run our integration tests.

On our test pages, we might have links to iframes (for example google tag manager). We would like to have an option to disable the loading of the content of the frames

royteeuwen pushed a commit to royteeuwen/htmlunit that referenced this issue Nov 15, 2023
royteeuwen pushed a commit to royteeuwen/htmlunit that referenced this issue Nov 15, 2023
royteeuwen pushed a commit to royteeuwen/htmlunit that referenced this issue Nov 15, 2023
@rbri
Copy link
Member

rbri commented Nov 15, 2023

@royteeuwen,
great to see HtmlUnit has some benefit for you.

Have done some documentation about content blocking some weeks ago - maybe that helps already
https://www.htmlunit.org/details.html#Content_blocking

And there is also a related FAQ entry (if i got you right)
https://www.htmlunit.org/faq.html#HowToModifyRequestOrResponse

Will have a look at your PR later today.

@rbri
Copy link
Member

rbri commented Nov 15, 2023

Oh there is something more - looks like you are not the first one having this wish....

You can set the FrameContentHandler of the WebClient to your own one returning false from the impl of loadFrameDocument()

@royteeuwen
Copy link
Author

OK i can try that!

Wouldn’t it be more clear / consistent to go for the provided option as in my PR though?

@rbri
Copy link
Member

rbri commented Nov 17, 2023

@royteeuwen does one of the suggestions work for you?

@royteeuwen
Copy link
Author

@rbri Yep, thanks!

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