From 2006270f6a338002df9a1950236db3dcacfc4ba9 Mon Sep 17 00:00:00 2001 From: "Mr. Stallion" Date: Mon, 1 Feb 2021 15:20:19 -0600 Subject: [PATCH] Fixes to image previews --- CHANGELOG.md | 2 +- chat/preview/assets/browser.pre.js | 8 +++++ chat/preview/assets/browser.processor.raw.js | 14 +++++++-- chat/preview/image-dom-mutator.ts | 9 +++--- chat/preview/image-url-mutator.ts | 33 +++++++++++++++++--- chat/preview/test-urls.txt | 15 ++++----- 6 files changed, 61 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e170206..78d2916 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Canary * Moved database queries to a web worker to gain more responsive UI -* Fixed Gelbooru, Instagram, and Twitter previews +* Fixed Gelbooru, Gfycat, Instagram, Twitter, and Vimeo previews * Fixed green names not showing up when 'show friends/bookmarks in a different colour' is selected * Sped up Imgur previews * Minor UI design adjustments for user names and badges diff --git a/chat/preview/assets/browser.pre.js b/chat/preview/assets/browser.pre.js index d92396c..f165ba9 100644 --- a/chat/preview/assets/browser.pre.js +++ b/chat/preview/assets/browser.pre.js @@ -131,3 +131,11 @@ const previewInitiationTime = Date.now(); } })(); + +try { + if (!!window.location.toString().match(/__x-suppress__/)) { + document.write("