swiss / styleguide

admin.ch styleguide
https://swiss.github.io/styleguide
MIT License
123 stars 36 forks source link

Twitter script loaded even if no Twitter component on the page #647

Open bgrand opened 6 years ago

bgrand commented 6 years ago

https://github.com/swiss/styleguide/blob/45603d74b3479883104f47324b6eb83bd0a83b8d/src/assets/js/twitter-timeline.js#L13

Even if the page contains no Twitter Timeline component, the browser tries to load the file https://platform.twitter.com/widgets.js. This external file should be accessed only if needed.

Soardiac commented 6 years ago

To show the timeline, data from twitter has to be obtained (obviously). Could this be implemented server side? Then there would be no need for the user browser to access twitter, even when timeline is used.

But why use twitter-timeline.js in a page with no Twitter Timeline anyway?

gillerr commented 4 years ago

already fixed on the CMS