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

Specify creating/opening a browsing context #116

Closed
foolip opened this issue Jul 14, 2021 · 6 comments · Fixed by #133
Closed

Specify creating/opening a browsing context #116

foolip opened this issue Jul 14, 2021 · 6 comments · Fixed by #133
Labels
enhancement New feature or request

Comments

@foolip
Copy link
Member

foolip commented Jul 14, 2021

Before one can navigate a browsing context, one has to be able to open one.

@whimboo
Copy link
Contributor

whimboo commented Jul 14, 2021

When the browser gets started there is always a default tab open, which implies that also a top-level browsing context (navigable) exists. When the last tab gets closed, the session automatically ends and the browser quits. So under which condition do we have to block the navigation? Isn't it just that we have to retrieve the current or a list of known to be open browsing contexts?

@jgraham
Copy link
Member

jgraham commented Jul 14, 2021

I think the concern is that if one doesn't specify how to create a browsing context, one can't be sure it already exists. Nothing really requires browsers to open a context at startup.

In practice a) browsers always do create a context at startup, so it's hard to get into a situation where there isn't one and b) we do need this feature for the same reasons we needed it in WebDriver classic. So I don't think we need to block on it but I also don't think we want to delay it too mcuh given it's not complex.

@whimboo
Copy link
Contributor

whimboo commented Jul 15, 2021

I think the concern is that if one doesn't specify how to create a browsing context, one can't be sure it already exists. Nothing really requires browsers to open a context at startup.

Sure but there is browsingContext.getTree() to get the list of open browsing contexts. Maybe we also just need a command to return the currently active navigable / browsing context.

@whimboo whimboo added the enhancement New feature or request label Jul 15, 2021
@foolip
Copy link
Member Author

foolip commented Jul 19, 2021

My concern stems from the fact that most Puppeteer examples one can find all open a new page and navigate it, rather than finding the already open page and using that. It's true that this doesn't block #43, but it seems like something we want sooner rather than later.

Even with such a command, it would still be good to specify that there should be exactly one browsing context for a new session, if we want clients to be able to depend on that and not waste that browsing context.

@jgraham
Copy link
Member

jgraham commented Jul 19, 2021

We could speccify that there must be at least one browsing context at session creation, but we can't specify that there must be exactly one (consider connecting to an already running browser, or a tool that does passive monitoring of network traffic and rendering timing for performance analysis. rather than driving tests itself).

@foolip
Copy link
Member Author

foolip commented Jul 19, 2021

At least one would do then :)

foolip added a commit that referenced this issue Sep 8, 2021
foolip added a commit that referenced this issue Nov 24, 2021
foolip added a commit that referenced this issue Nov 30, 2021
Fixes #116.

Co-authored-by: Henrik Skupin <mail@hskupin.info>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants