Skip to content

Commit

Permalink
Remove twitter external script
Browse files Browse the repository at this point in the history
  • Loading branch information
benmcgarry committed Mar 24, 2024
1 parent 6bb4343 commit 10b825f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/modules/hosts/twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export default new Host('twitter', {
attribution: false,
detect: ({ href }) => (/^https?:\/\/(?:mobile\.)?twitter\.com\/(?:#!\/)?[\w]+\/status\/?[\w]+/i).exec(href),
async handleLink(href, [url]) {
// we have to omit the script tag and all of the nice formatting it brings us in Firefox
// we have to omit the script tag and all of the nice formatting it brings us in Firefox/Chrome
// because AMO does not permit externally hosted script tags being pulled in from
// oEmbed like this...
// oEmbed like this and MV3 prevents it with CSP...
const { html } = await ajax({
url: 'https://publish.twitter.com/oembed',
query: { url, omit_script: process.env.BUILD_TARGET === 'firefox' },
query: { url, omit_script: true },
type: 'json',
});

Expand Down

0 comments on commit 10b825f

Please sign in to comment.