Skip to content

Fix tweet replacement on websites that assign window.twttr to a local var#3161

Draft
ghostwords wants to merge 1 commit into
masterfrom
update-twttr-surrogate
Draft

Fix tweet replacement on websites that assign window.twttr to a local var#3161
ghostwords wants to merge 1 commit into
masterfrom
update-twttr-surrogate

Conversation

@ghostwords

@ghostwords ghostwords commented Dec 19, 2025

Copy link
Copy Markdown
Member

Sites might do something like let c = window.twttr = {... and then later call c.widgets.createTweet() (from inside the _e callback array). If we redefine window.twttr unconditionally, c no longer points to the right place.

For example: https://ftw.usatoday.com/story/sports/nhl/2025/12/19/flyers-radio-announcer-tim-saunders-suspended-todd-fedoruk/87845326007/

Should see if we have a similar situation with YouTube.

@ghostwords ghostwords changed the title Fix tweet replacement on websites that predefine window.twttr Fix tweet replacement on websites that assign window.twttr to a local var Dec 19, 2025
@ghostwords ghostwords added widgets Click-to-activate placeholders for blocked but potentially useful social buttons/widgets surrogates Replacement blank/noop/dummy/neutered versions of tracking scripts used to avoid site breakages labels Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

surrogates Replacement blank/noop/dummy/neutered versions of tracking scripts used to avoid site breakages widgets Click-to-activate placeholders for blocked but potentially useful social buttons/widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant