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.

Syncing viewport from server

See original GitHub issue

This is not a bug, more of a question. I have the following code:

var connectOptions = new ConnectOptions()
{
      BrowserWSEndpoint = "ws://..."
};

var browser = await Puppeteer.ConnectAsync(connectOptions);

var pages = await browser.PagesAsync();

foreach (var page in pages)
{
       JObject response = await page.Client.SendAsync("Performance.getMetrics");
       Console.WriteLine("Response is " + response.ToString());
}

To my surprise, as soon as the command ran, it resized the viewport to the default (800,600). My expectation would be that if a viewport was already set on the server, it shouldn’t modify it. If there is already a viewport set on the server, the PuppeteerSharp state should be synchronized to match it. Thoughts?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kblokcommented, Sep 18, 2019

@chitoiur you could try to get that using a javascript code and calling EvaluateFunctionAsync

0reactions
Mercurialcommented, Dec 22, 2019

this was helpful to me, thanks! hopefully this becomes better in the future

Read more comments on GitHub >

github_iconTop Results From Across the Web

Work with viewports
Viewports are specialized components that enable you to extend your experience without needing to own the parent page in UI Builder. You can...
Read more >
Overhaul Productivity: Reduce Wait Times (Project Sharing ...
We're talking about simple line drawings. This becomes a real problem when a viewport is out-of-date (often when 'save viewport cache is turned ......
Read more >
Houdini Engine 5.0: SessionSync
The Houdini viewport can be synchronized with other application viewports through the use of HAPI_Viewport, HAPI_GetViewport(), and HAPI_SetViewport().
Read more >
How do I keep an MMO synchronized?
It's just a read only game at the moment. My idea is, to tell the server where a player is and how big...
Read more >
Solved: Viewport sync and extents - AutoCAD
Solved: Hi all, A strange problem has been plaguing my autocad drawings. On some drawings, if I double click on a viewport it...
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