Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

whizsid
Copy link

@whizsid whizsid commented Jul 17, 2020

Ability to install or uninstall extensions and control browser specific features.

@whizsid
Copy link
Author

whizsid commented Jul 17, 2020

Some test cases failed. I think the websites has changed.

left: `["Help", "Community portal", "Recent changes", "Upload file"]`,
 right: `["Help", "About Wikipedia", "Community portal", "Recent changes"]`

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> {
Copy link
Owner

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> :)

Copy link
Author

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

Copy link
Owner

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.

Copy link
Owner

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?

Copy link
Author

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.

@jonhoo
Copy link
Owner

jonhoo commented Jul 24, 2020

Sorry it took me so long to get back to you!

@ChaseCares
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants