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

BREAKING: add firefox support #52

Merged
merged 45 commits into from
Apr 9, 2021
Merged

Conversation

ebebbington
Copy link
Member

@ebebbington ebebbington commented Feb 15, 2021

Fixes #24

Summary

  • To support firefox, the API has been changed slightly, this makes both chrome and firefox classes maintainable. Tests have been adjusted for this and it was pretty quick and easy to do luckily
  • API's for firefox and chrome client are exactly the same
  • Requires a new permission: --allow-write if using firefox. example: deno run --allow-read=$TMPDIR app_test.ts
  • Options can be passed to the build method, to customise the client
  • The API is now as follows:
import { buildFor } from  "https://deno.land/x/sinco/mod.ts"

const Sinco = await buildFor("chrome", ...opts) // or replace "chrome" with "firefox"
await Sinco.goTo("https://drash.land") // as usual
  • Added firefox support
  • Removed waitForAnchorChange method

@ebebbington ebebbington added the Type: Major Merging this pull request results in a major version increment label Feb 15, 2021
@ebebbington
Copy link
Member Author

ebebbington commented Feb 20, 2021

so im debating removing the waitForAnchorChange.. for context, the method looks like:

public async waitForAnchorChange(): Promise<void> {
    const notificationPromise = this
      .notification_resolvables["Page.navigatedWithinDocument"] = deferred();
    await notificationPromise;
    delete this.notification_resolvables["Page.navigatedWithinDocument"];
  }

It's not really a 'sought after method'
and it's used like:

await Sinco.type(..., "new val") // on chromestatus.com, theres an input field that changes the uri
await Sinco.waitForAnchorChange() // essentially waits until url is https://chromestatus.com/features#new%20val

But if i go to chromestatus.com, and change the value of the input field in the console manually, the uri doesn't change, but the chrome client does pick up an event for this in the tests

Alongside this, if i do the same with a firefox client, the client doesn't pick up any event for this

Is there a need for this method?

@ebebbington ebebbington marked this pull request as ready for review February 22, 2021 09:32
@ebebbington ebebbington changed the title [WIP] BREAKING: add firefox support BREAKING: add firefox support Feb 22, 2021
@ebebbington ebebbington merged commit 00a8ded into master Apr 9, 2021
@ebebbington ebebbington deleted the issue-#24-add-firefox-support branch April 9, 2021 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Major Merging this pull request results in a major version increment
Development

Successfully merging this pull request may close these issues.

Is there any way to run Dawn without Chrome?
3 participants