question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Method to uniquely identify Pages/Targets?

See original GitHub issue

When using browser.pages() or browser.targets() is there a way to uniquely identify each Page object? I.e. is there some property of the Page object that I can compare with those returned by browser.pages() to identify if they’re both referencing the same browser tab?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Khadycommented, Nov 22, 2017

Can you please share if there are other tools besides lighthouse that you use? I’d love to take a look.

For now, I’m using puppeteer, lighthouse, chrome-launcher and handmade requests using CDP or the /json,/json/version,/new,/close commands. Trying to unify all this. I’m happy using page._client.targetId for now.

I created an issue and a PR on lighthouse repository while trying to find a nice way to mix puppeteer and lighthouse. But the story doesn’t seem to be as easy as expected. I would be very happy to see a conversation/guideline about the interop between those two tools.

This specific PR is relying on the targetId. But I’m not a CDP/Chrome expert. So there is maybe a better way to achieve this rather than to pass an id everywhere.

0reactions
aslushnikovcommented, Nov 21, 2017

I still think it would be interesting to have the targetId exposed. I use it while debugging (checking the number of pages opened, which ones are opened, etc) from outside of puppeteer.

@Khady would it help if we give you a nicer toString() for target/page objects?

And to pass it to other tools like lighthouse.

Can you please share if there are other tools besides lighthouse that you use? I’d love to take a look.

The lighthouse has been mentioned a few times already; we’d probably need to do a better interop. cc @paulirish

Read more comments on GitHub >

github_iconTop Results From Across the Web

Method to uniquely identify Pages/Targets? #1428 - GitHub
When using browser.pages() or browser.targets() is there a way to uniquely identify each Page object? I.e. is there some property of the ...
Read more >
c# - Uniquely identifying a method or constructor using reflection
I need to uniquely identify a method or constructor for any given class so that I can then invoke it at a later...
Read more >
Page Related Tools — ActionKit Manual - Dream.org
You can perform A/B tests on your ActionKit pages so you can conduct real-world experiments by seeing how changes will perform based on...
Read more >
SEO Content Analysis: How to Evaluate New and Existing ...
SEO content analysis is a way to identify and eliminate them. I, typically, split the content analysis into two phrases: Evaluating existing ...
Read more >
Importing FrameMaker® Files into MadCap Flare
During the FrameMaker® import process, Flare will ask you to ... will simply need to update the information in your master pages, targets, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found