galaxy-hub
galaxy-hub copied to clipboard
Twitter analytics elements are sticky
When you visit a page with a Twitter timeline embed (currently just the homepage), it creates a couple <iframe>
s in the page, one of which helpfully titles itself "Twitter analytics iframe". This is of course expected when you invite Twitter onto your page. But what's not quite as expected, at least to users, is that these iframes remain after you click to another page on the Hub. So basically, Twitter is blind to your activity until you wind up on a page with a Twitter embed, and from then on it can watch the rest of your visit as you browse the Hub.
This is unsurprising in hindsight, since Gridsome behaves as a single page application after the initial load. So of course those iframes will stick around, since we never fully reload the page. It's not even (necessarily) some sneaky trick by Twitter; it's just an accident of how Gridsome is built.
We could probably eliminate this pretty easily by adding some code to Default.vue which deletes these iframes if you're not on a page with a Twitter embed.
One solution would be to try to avoid using their embed code entirely. Looks like this site did it by using the twitter-lite library to directly query the Twitter API.