-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
webdriver support #281
webdriver support #281
Conversation
Linux only so far. Until further notice, this entire branch is going to only work on Linux until I can decide on a good interface to expose WebDriver stuff. `Application` makes it so that multiple windows can share a single WebContext and UserContentManager (data directory). This is required for WebDriver because only a single `WebContext` is allowed to be marked to allow automation. It seems that macOS and Windows have similar limitations to some extent. Only the multi_window example has been updated so far.
again, linux only for now. updated detect_js_ecma example also
is there a better proper fix? probably - but we will be redoing this interface soon I imagine.
@wusyong tagging you in a comment since I don't want to mark this as Review until we know how we want to expose |
I prefer to move all the setup of |
I'll look into this approach |
Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <[email protected]>
right now the |
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
The PR fulfills these requirements:
fix: #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information:
I marked this as a draft cause the interfaces are not final. If a release is not planned soon, then this can be merged and the
Application
interface can be worked on before the next release. LMK if the non-final interface is okay to merge for now and I'll mark it for review.Overall this was less lines of code than I thought, but putting it together correctly in the right order was important. I guess since we are heavily leveraging existing webdriver servers (
WebKitWebDriver
andmsedgedriver
) it was mostly about enabling proper support for them.Some notes on the changes:
webkit2gtk
starts webdriver support onv2_18
so I bumped it up to that.unix::ApplicationExt
allows setting the automation flag forApplication
because there is only allowed to be 1 automation context at a time. The other platforms have similar limitations I imagine (just from how webdriver works typically), butwebkit2gtk
semi-enforces this through the api.wry::Application
is back for the above reason. It should be thought of/acts like a "browser" where there might be multiple windows and/or tabs but it refers to the same context. Like how incognito mode is a single context that shares multiple windows/tabs. It doesn't really do anything other than represent some context specific data.I'm thinking that
wry::Application
can be made into a builder, and start adding items that are getting passed toInnerWebView::new()
to it that make sense. So far, I've only moved overdata_directory
.Also, because we now have
wry
specific stuff in application (Application
andmod unix
), it gets mixed in with the tao re-exports. Maybe we should move the tao re-export to the crate root and maybe also add root re-exports for items expected to be used by most wry applications (EventLoop
,WindowBuilder
,Application
,WebviewBuilder
, ect...)only linux + windows for now