I was looking back over my old certification projects and I realized that the tweet button on my Quote Machine project wasn’t working. (It was working the last time I interacted with it.) I tested it in another browser, and tested FreeCodeCamp’s Official Example
and continued to receive a “twitter.com refused to connect” error.
User story #10 in the instructions for this project states
I can tweet the current quote by clicking on the
aelement should include the
"twitter.com/intent/tweet"path in its
hrefattribute to tweet the current quote.
So I did some digging in Twitter’s web intents documentation and found
“Web intents cannot be loaded inside an iframe”
I looked into how CodePen renders its projects, and in both the editor and full views, it renders as an iframe. Since the user has no control over Twitter’s rules, or how CodePen renders the project, I don’t know how a tweet button could be successfully implemented in this project. If necessary, I am willing to create a github issue for this, but I wanted to check here first.