accept any content-type for text/ except text/html

This commit is contained in:
tophf 2020-11-10 21:40:50 +03:00
parent 3a8f47f4db
commit d183779fb5

View File

@ -4,7 +4,8 @@
(() => { (() => {
const installCodeCache = {}; const installCodeCache = {};
const clearInstallCode = url => delete installCodeCache[url]; 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:// // in Firefox we have to use a content script to read file://
const fileLoader = !chrome.app && ( const fileLoader = !chrome.app && (