Skip to content

Fix Letterboxd TMDB link selector#64

Open
CameronGarrett wants to merge 1 commit into
RemiRigal:masterfrom
CameronGarrett:fix/letterboxd-tmdb-selector
Open

Fix Letterboxd TMDB link selector#64
CameronGarrett wants to merge 1 commit into
RemiRigal:masterfrom
CameronGarrett:fix/letterboxd-tmdb-selector

Conversation

@CameronGarrett

Copy link
Copy Markdown

Summary

  • Letterboxd removed the data-track-action="TMDB" attribute from their TMDB links, breaking the extension on all Letterboxd film pages
  • The selector now falls back to matching links by href containing themoviedb.org
  • Original data-attribute selector preserved for backwards compatibility

Details

The current selector:

$('a[data-track-action=TMDB]:first')

returns nothing on Letterboxd film pages because the TMDB link no longer has a data-track-action attribute. This causes tmdbURL to be undefined, crashing at line 11:

TypeError: can't access property "includes", tmdbURL is undefined

The fix adds a fallback:

$('a[data-track-action=TMDB]:first, a[href*="themoviedb.org"]:first').first()

Test plan

  • Verified on https://letterboxd.com/film/fight-club/ — extension now correctly finds TMDB ID and shows request status
  • Original selector still takes priority if data-track-action attribute is present

Letterboxd removed the `data-track-action="TMDB"` attribute from their
TMDB links, causing `tmdbURL` to be undefined and crashing the content
script with `TypeError: can't access property "includes", tmdbURL is
undefined`.

Add a fallback selector that matches by href containing
"themoviedb.org". The original data-attribute selector is preserved for
backwards compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant