diff --git a/scripts/helpers.js b/scripts/helpers.js index 08d455e8..9f3a5871 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -3502,7 +3502,7 @@ async function appendTweet(t, timelineContainer, options = {}) { if (item.type === 'photo') { url.searchParams.set("name", "orig"); // force original resolution } - fetch(url).then(res => res.blob()).then(blob => { + _fetch(url).then(res => res.blob()).then(blob => { downloading = false; let a = document.createElement('a'); a.href = URL.createObjectURL(blob); diff --git a/scripts/twchallenge.js b/scripts/twchallenge.js index e730a272..100d0bde 100644 --- a/scripts/twchallenge.js +++ b/scripts/twchallenge.js @@ -66,7 +66,7 @@ window.addEventListener('message', e => { } }); -let _fetch = window.fetch; +window._fetch = window.fetch; fetch = async function(url, options) { if(!url.startsWith('https://twitter.com/i/api') && !url.startsWith('https://api.twitter.com')) return _fetch(url, options); if(!options) options = {}; diff --git a/scripts/tweetviewer.js b/scripts/tweetviewer.js index bcaf03bc..aef482a8 100644 --- a/scripts/tweetviewer.js +++ b/scripts/tweetviewer.js @@ -2442,7 +2442,7 @@ class TweetViewer { downloading = true; let media = t.extended_entities.media[0]; let url = media.type === 'photo' ? media.media_url_https : media.video_info.variants[0].url; - fetch(url).then(res => res.blob()).then(blob => { + _fetch(url).then(res => res.blob()).then(blob => { downloading = false; let a = document.createElement('a'); a.href = URL.createObjectURL(blob);