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.

[Question] Way for capturing screenshot with `:visited` style?

See original GitHub issue

Description

Serve HTML on http://localhost:3000/index.html:

<style>
  a:visited { color: red }
</style>

<a id="visited" href="/visited.html">Visited</a>
<a id="not-visited" href="/not-visited.html">Not Visited</a>

And run:

await page.goto("http://localhost:3000/index.html");
await page.click(`a#visited`);
await page.goBack();

await page.screenshot({ path: "./screenshot.png" });

Then, screenshot.png:

screenshot

Expected (captured by hand operation):

image

Why :visited styles are ignored?

For privacy reason. To prevent history leaking, window.getComputedStyle return a lie property.

Ref:

Question

Is there any way to capturing screenshot with :visited style?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
pavelfeldmancommented, Jan 1, 2022

Why was this issue closed?

We are prioritizing the features based on the upvotes, recency and activity in the issue thread. It looks like this issue only has a handful of upvotes, has not been touched recently and/or we lack sufficient feedback to act on it. We are closing issues like this one to keep our bug database maintainable. Please feel free to open a new issue and link this one to it if you think this is a mistake.

1reaction
pavelfeldmancommented, Jun 1, 2021

I think we are missing this feature, so it can be considered a Playwright bug. Let me start collecting upvotes for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 Kinds of Screenshots You Need to Start Using Immediately
Screenshots, screen captures, and screen recordings all seem the same, but are they? Learn the key differences and how why they matter to...
Read more >
Screen Capture - Qualtrics
The screen capture question allows respondents to attach a screenshot of the site they are viewing when taking a survey through Website Feedback....
Read more >
Take a screen capture and use it as an image in an email
Take a screenshot on a Mac · Shift-Command (⌘)-4 on your keyboard to select the area you want to take a screenshot of....
Read more >
Any way to enable full styling of :visited links in firefox?
No, you cannot do that. See styling restrictions for :visited : For privacy reasons, browsers strictly limit which styles you can apply ...
Read more >
visited - CSS: Cascading Style Sheets - MDN Web Docs
The :visited CSS pseudo-class applies once the link has been visited by the user. For privacy reasons, the styles that can be modified...
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