Search code examples
javascripthtmlreactjsanchorthird-party-cookies

How to troubleshoot third-party cookie restrictions?


I recently noticed that news links in my personal project site have broken, and there are a few 3rd-party cookie restrictions/warnings that I hadn't noticed before (showing up in the developer console).

Basically, the React <Card.Link> href's no longer open to desired link. This happened without any changes to the code. The links worked fine a few days ago and suddenly stopped working. Each link also does not even appear to be a link when hovering over each news title with the cursor (shown in screenshot).

news link

I have looked at Google's updated 3rd-party cookie restrictions, but I can't actually tell if that is what has broken my links. The links can be viewed here: omitted

Each href URL that is in the rendered page is still valid when manually copy/pasted into the URL bar of the browser. The React code also appears to be valid.

Replacing the React Card.Link tags with regular anchor tags does not fix the problem.

I am wondering if the 3rd-party cookie policy is what broke the site? I have also tried many browsers and different devices. The links stopped working completely.

I do have an Iframe in my site, but removing that does not fix the issue. I can see that Google Analytics is also highlighted in the third-party cookie-issues section of the developer console. Removing the Iframe and link to Google Analytics did not solve the broken links.

Enabling 3rd-party cookies in Privacy/Security settings also has no effect. How can I troubleshoot if the broken news links are related to 3rd-party cookies? Or possibly Google is somehow blocking me from using their news links?

Thank you for taking the time to look.


Solution

  • If the following is added to .card-body, the problem is resolved:

    position: relative;
    z-index: 2;
    

    The reason the links are not clickable is because .card-img-overlay is absolutely positioned and is overlapping the card body (and so also the link) such that it is blocking it.

    It's pretty much certain this was not sudden. If it was working before, the code has changed or you were looking at a different environment without realising.