Sign in
Log inSign up

Twitter Follow button doesn't work

Bogdan Bujdea
·Oct 20, 2020·

1 min read

Issue

The button is added to a blog post when I use the widget code, but when I click on it the request is blocked. This is the error I receive on Edge(Chromium) and Chrome:

net::ERR_BLOCKED_BY_CLIENT

This document was blocked from loading in an iframe with a sandbox attribute because this document specified a cross-origin opener policy.

Steps to reproduce

  • add a widget with the following code:
<a href="twitter.com/thewindev" class="twitter-follow-button" data-size="large" data-dnt="true" data-show-count="false">Follow @thewindev</a><script async src="platform.twitter.com/widgets.js" charset="utf-8"></script>
  • add the widget in an article and preview it or save it and open the article so you can see the follow button.

  • click on the button.

Expected results: A new tab should open with the Twitter profile.

Actual result: A new tab opens but you get the errors above.

The button works if you right click on it and then "Open link in a new tab", or if you copy/paste the URL in a new tab. Probably there's a CORS issue or something like that because it doesn't like when the request is done from hashnode.

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct