Browser options :pending_connection_allowlist and :pending_connection… #537
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
UseCase
When I visit
/testit downloadsmain.jswhich is needed for the page, then pre-loadsp1.js,p2.js&p3.jsFrequently there is a
PendingConnectionsErroron one of the pre-load javascript files.This feature will allow me to say: Don't raise a
PendingConnectionsErrorfor any javascript file, exceptmain.jswhich is the important one.Changes
README.md: - browser options info updated.
lib/ferrum/browser.rb:80 - updated @option comments.
lib/ferrum/browser/options.rb:16 - added
attr_readerfor:pending_connection_allowlistand:pending_connection_blocklist.lib/ferrum/browser/options.rb:34 - set the new options from the arguments.
lib/ferrum/page.rb:118 + 539 - added method
:process_timeout_error(url)to compare the lists and raise.spec/browser_spec.rb:245 - added tests for both lists.
Cuprite
If this PR is accepted, I'll do a PR for cuprite to include this feature.
Hope you're happy with it: 🤞