From d183779fb597695a08914b6e9dfe6e16e972e468 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 10 Nov 2020 21:40:50 +0300 Subject: [PATCH] accept any content-type for text/ except text/html --- background/usercss-install-helper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/background/usercss-install-helper.js b/background/usercss-install-helper.js index b854564a..b0fbb593 100644 --- a/background/usercss-install-helper.js +++ b/background/usercss-install-helper.js @@ -4,7 +4,8 @@ (() => { const installCodeCache = {}; const clearInstallCode = url => delete installCodeCache[url]; - const isContentTypeText = type => /^text\/(css|plain)(;.*?)?$/i.test(type); + /** Sites may be using custom types like text/stylus so this coarse filter only excludes html */ + const isContentTypeText = type => /^text\/(?!html)/i.test(type); // in Firefox we have to use a content script to read file:// const fileLoader = !chrome.app && (