-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
webbrowser: implement Webbrowser / ChromiumWebbrowser #5386
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
Conversation
fa07ad1
to
8312d3b
Compare
8312d3b
to
b7931c7
Compare
Rebased to current head of master, because this PR is the base branch for other PRs until it got merged into master. Also disabled that one flaky test on Windows because I'm already annoyed by it. |
c739035
to
8d1c786
Compare
as well as pytest-trio and trio-typing
Implement utility function for resolving executables, with default names and fallback paths
8d1c786
to
1da1dc9
Compare
The base class for launching a web browser and interacting with it. Uses trio for async I/O.
Extends the base Webbrowser class with known Chromium/Chrome executable names and fallback paths on Windows and macOS, as well as an extensive list of launch arguments for disabling unneeded features and behaviors when running and controlling it via the Chrome Devtools Protocol (CDP).
1da1dc9
to
13bfa16
Compare
Rebased to master, fixed order of commits (dependencies first), added missing trio dependency note to docs and added API stability comment to the |
Thinking about it, it would probably make sense adding MSEdge to the executables list and fallback path list on Windows, even with a higher priority, since it's installed by default and can't be removed on this OS. The old non-Chromium Edge is dead, right? |
Part 2/4 of #5380
Opening this as a draft was well until I have the rest finished.
This
trio
dependency, as well aspytest-trio
andtrio-typing
trio-typing
looks like it's going to get merged intotrio
soonpytest-trio
is used for initializing the runloop in async tests, similar topytest-asyncio
.Having implementations for both
asyncio
andtrio
seems to cause minor issues with trio's runloop in the tests, and on Windows it triggers a warning when asyncio was run prior to its own runloop. This is related tosignal.set_wakeup_fd()
. This can be resolved in the future by re-implementing theutils.processoutput
based on trio instead of asyncio. The other asyncio stuff is purely concurrency related and not I/O related, so it's irrelevant which runloop we're using. The warning can be ignored for now.Webbrowser
base class with the basic launch implementationChromiumWebbrowser
classPATH
env var nonsense)Headless mode is currently not added, but this can be done with a simple class argument. I can't get a valid client-integrity token on Twitch with headless mode, regardless of what others are saying, so I don't see the point right now.