Skip to content

Commit

Permalink
Add support for twitter expandos on x.com links (twitter rename) (#5476)
Browse files Browse the repository at this point in the history
  • Loading branch information
aitchpat authored Mar 25, 2024
1 parent 701ea16 commit abf25d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/modules/hosts/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { ajax } from '../../environment';

export default new Host('twitter', {
name: 'twitter',
domains: ['twitter.com'],
domains: ['twitter.com', 'x.com'],
permissions: ['https://publish.twitter.com/oembed'],
attribution: false,
detect: ({ href }) => (/^https?:\/\/(?:mobile\.)?twitter\.com\/(?:#!\/)?[\w]+\/status\/?[\w]+/i).exec(href),
detect: ({ href }) => (/^https?:\/\/(?:mobile\.)?(twitter|x)\.com\/(?:#!\/)?[\w]+\/status\/?[\w]+/i).exec(href.replace('x.com', 'twitter.com')),
async handleLink(href, [url]) {
// we have to omit the script tag and all of the nice formatting it brings us in Firefox/Chrome
// because AMO/MV3 does not permit externally hosted script tags being pulled in from
Expand Down

0 comments on commit abf25d4

Please sign in to comment.