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

chore: remove page.queryObjects API #31

Merged
merged 1 commit into from
Nov 20, 2019
Merged

chore: remove page.queryObjects API #31

merged 1 commit into from
Nov 20, 2019

Conversation

pavelfeldman
Copy link
Member

No description provided.

@pavelfeldman pavelfeldman merged commit 48a78b2 into microsoft:master Nov 20, 2019
@pavelfeldman pavelfeldman deleted the queryObjects branch November 20, 2019 17:28
@subzey
Copy link

subzey commented Jan 23, 2020

Will queryObjects be reintroduced?

@yury-s
Copy link
Member

yury-s commented Jan 23, 2020

@subzey we don't have any immediate plans on reintroducing this. Out of all browsers only Chromium support this and we'd need to have a good rational for implementing it in other browsers. The cost of that didn't seem justified given the limited utility of the feature and more comprehensive heap analysis tools that exist in the browsers.

With that said, if you have a strong case for that, please open an issue, we can reconsider that.

@subzey
Copy link

subzey commented Jan 27, 2020

To be honest, I don't really need it to be implemented in other browsers.

In my case the queryObjects() is used to check if a JS component has cleaned its DOM subscriptions - addEventListener, setTimeout, or rAF - when it is destroyed.

The lifecycle test looks like this:

  • Create and init some component.
  • Remove and destroy it.
  • Run queryObjects() to check if it has been (or can be) garbage collected.
  • If there are still dangling instances, fail the test.

This method is really handy and gives much more information than something like "Used heap size increased". The lack of support in other browsers is really not an issue: if it leaks it leaks everywhere.

Can you please suggest something to replace it?

Or maybe there's a way to invoke it using raw CDP commands? I've tried to use the ChromiumSession, but no luck so far.

@yury-s
Copy link
Member

yury-s commented Jan 27, 2020

I get your point about more detailed information that queryObjects() provides but we want to keep feature parity across browsers and this one is not at the top of the list at the moment.

You should still be able to achieve the same result in Chromium via raw protocol using the ChromiumSession and Runtime.queryObjects command. You'll need to evaluate prototypeObjectId in the new session.

sand4rt pushed a commit to sand4rt/playwright that referenced this pull request Dec 21, 2022
@Dolov Dolov mentioned this pull request Oct 24, 2023
1 task
sand4rt added a commit to sand4rt/playwright that referenced this pull request Nov 4, 2023
sand4rt added a commit to sand4rt/playwright that referenced this pull request Nov 5, 2023
sand4rt added a commit to sand4rt/playwright that referenced this pull request Nov 5, 2023
sand4rt added a commit to sand4rt/playwright that referenced this pull request Nov 5, 2023
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