-
Notifications
You must be signed in to change notification settings - Fork 133
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
Extensions feature #92
base: main
Are you sure you want to change the base?
Conversation
Some test cases failed. I think the websites has changed.
And exceeded the maximum time. |
use webdriver::error::ErrorStatus; | ||
use webdriver::error::WebDriverError; | ||
|
||
type Ack = oneshot::Sender<Result<Json, error::CmdError>>; | ||
|
||
/// A WebDriver client tied to a single browser session. | ||
#[derive(Clone, Debug)] | ||
pub struct Client { | ||
tx: mpsc::UnboundedSender<Task>, | ||
pub struct Client<T: ExtensionCommand> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making the Client
generic over this is a huge and backwards-incompatible change that I'd prefer to avoid. I think it'd be better to instead use a trait object, and pass around Box<dyn WebDriverExtensionCommand>
. That way you can get rid of all these <T>
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonhoo I am getting an error when using Box<dyn WebDriverExtensionCommand>
. Error:- the trait
WebDriverExtensionCommand cannot be made into an object
. Because WebDriverExtensionCommand
is extend to PartialEq
. Can you help me to resolve this:- https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=91be6634f09c530866951321286b8d2c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, hmm, that's really awkward... That seems like a bug in the WebDriverExtensionCommand
trait to me, which will unfortunately require reporting a bug to that crate to resolve. Without that, there isn't a way for us to add this functionality without significantly complicating the API for (seemingly) no reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@whizsid did you end up filing an issue with the upstream crate for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonhoo Yes. I submitted an issue. They shipped it with the latest release. I will update my PR.
Sorry it took me so long to get back to you! |
Hello, I am interested in this feature for a project I am currently working on. @whizsid Do you have any interest in continuing with it? I'm also willing to rework the traits, rebase and resubmit. Thanks! |
Ability to install or uninstall extensions and control browser specific features.