answers ^#blog


Marking clicked links as visited
Marking clicked links as visited

Marking clicked links as visited

Linking the web is THE best practice in the World Wide Web. Users are visiting any content. And in a sort of magical ability of remembrance, the link is marked in a specific color on any webpage where a link is placed to this specific visited URL. The ability to do so is given to developers by the :visited pseudo class all around HTML. This was pretty much default until, now (note the date of this article).

This magical kind of remembering visited webpages is no longer enabled within the Google Chrome Browser. Presumably, other browsers will follow. Chrome changed the behavior for remembering clicked links with privacy protection in mind. You can find some detailed explanation on GitHub. In short, links that are clicked are from Chrome Version 133 on partitioned via triple keying. Previously, when a user has visited a webpage, all across the web, the browser recognized the URL with the :visited class added. This might have exposed some page visits unintentionally.

Deciding if this is a feature or a bug, in my humble opinion, mostly depends on the restrictions in granting access to the device and its browser. Additionally, there are other scenarios where data can be exposed. Google provided a detailed presentation, you can find here.

For some use cases it might be useful to mark visited links, mostly for readability purposes, I guess. For regaining this feature, Chrome provides chrome://flags, Partition the Visited Link Database, including ‘self-links’ and Partition the Visited Link Database. By disabling this flags, the user regains the privacy exposing behavior of hers/his browser.

As a web developer, there is no such easy workaround for your projects. In my case, figuring out when a link is marked correctly didn’t work out. If you have any experience in solving this, please leave a comment.

My way to ensure a constant user experience was to build a JavaScript snippet which stores clicked links in the localStorage of the users’ browser. This should respect the privacy manners of your users and enables the “visited” marking again.


In your CSS file, you also have to add .YOURCLASS.visited and style it properly. As this is a customized declaration, you not necessarily have to consider the common :visited restrictions.

The script stores all clicked URLs for 7 days in the localStorage of the users’ browser. You can check it in Chrome Dev Tools. It does not integrate the user’s browsing history; it just stores the data generated on your website for the current user/browser.

In summary, for all clicked links on the website, web developers can provide such styling via JavaScript and CSS, easily. The marking will be provided, and the privacy concerns will be avoided. Attackers can not frame an attack within a reliable website and will be hold to the Mainframe.

If you have any feedback or want to have this in your web project, feel free to get in contact.

This is a solution with:

JavaScript

Featured image comes from pexels.

Linking the web is THE best practice in the World Wide Web. Users are visiting any content. And in a sort of magical ability of remembrance, the link is marked in a specific color on any webpage where a link is placed to this specific visited URL. The ability to do so is given to developers by the :visited pseudo class all around HTML. This was pretty much default until, now (note the date of this article).

This magical kind of remembering visited webpages is no longer enabled within the Google Chrome Browser. Presumably, other browsers will follow. Chrome changed the behavior for remembering clicked links with privacy protection in mind. You can find some detailed explanation on GitHub. In short, links that are clicked are from Chrome Version 133 on partitioned via triple keying. Previously, when a user has visited a webpage, all across the web, the browser recognized the URL with the :visited class added. This might have exposed some page visits unintentionally.

Deciding if this is a feature or a bug, in my humble opinion, mostly depends on the restrictions in granting access to the device and its browser. Additionally, there are other scenarios where data can be exposed. Google provided a detailed presentation, you can find here.

For some use cases it might be useful to mark visited links, mostly for readability purposes, I guess. For regaining this feature, Chrome provides chrome://flags, Partition the Visited Link Database, including ‘self-links’ and Partition the Visited Link Database. By disabling this flags, the user regains the privacy exposing behavior of hers/his browser.

As a web developer, there is no such easy workaround for your projects. In my case, figuring out when a link is marked correctly didn’t work out. If you have any experience in solving this, please leave a comment.

My way to ensure a constant user experience was to build a JavaScript snippet which stores clicked links in the localStorage of the users’ browser. This should respect the privacy manners of your users and enables the “visited” marking again.


In your CSS file, you also have to add .YOURCLASS.visited and style it properly. As this is a customized declaration, you not necessarily have to consider the common :visited restrictions.

The script stores all clicked URLs for 7 days in the localStorage of the users’ browser. You can check it in Chrome Dev Tools. It does not integrate the user’s browsing history; it just stores the data generated on your website for the current user/browser.

In summary, for all clicked links on the website, web developers can provide such styling via JavaScript and CSS, easily. The marking will be provided, and the privacy concerns will be avoided. Attackers can not frame an attack within a reliable website and will be hold to the Mainframe.

If you have any feedback or want to have this in your web project, feel free to get in contact.

This is a solution with:

JavaScript

Featured image comes from pexels.

furthermore

Aspect ratio Media Query

Adding a gradient as background in WordPress

Losing focus

Release note

Marking clicked links as visited

Like the Clintons’ did

Screen orientation reloaded

Merry Christmas everybody

Browsers render different

Obsolescence childish

Make footer lines static in WordPress

Light and dark vs. black and white

Just like a rolling stone

With love

answers

^#blog


3close Agency UG Logo

by commenting this article, you agree to the privacy policy & the storage of the personal data you provide.

Leave a Reply

Your email address will not be published. Required fields are marked *