My FeedDiscussionsBookmarks

Twitter Follow button doesn't work

Bogdan Bujdea
·Oct 20, 2020·

1 min read


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:


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="" class="twitter-follow-button" data-size="large" data-dnt="true" data-show-count="false">Follow @thewindev</a><script async src="" 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.