Add request event handling on BrowserContext #29
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.
Description
This is a small fix for handling request events. Request events come in through the BrowserContext object on the
subscribe_event()
function but the current rust code is expecting it on the Page object which cannot receive those events based on the current implementation.For reference we can look at how playwright-java handles these events (in the BrowserContextImpl.java and PageImpl.java files). I think we are forced to do it this way based on what the playwright driver is sending to us, though I'm not 100% sure since I'm still learning this codebase.
My changes
I added request event handling to the imp/BrowserContext.rs class and updated all related files needed to catch and rely the event.
Warning
This contains code from another pull request that updates the driver version (see PR #26).