From f8d2bd0ebb6620263b766066d5b4489ba23c01f6 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Sun, 1 Jan 2023 09:33:20 -0500 Subject: [PATCH] Set `charset` to `utf-8` for Blob-based injected scriptlets Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/2431 --- src/js/contentscript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/contentscript.js b/src/js/contentscript.js index 14b6dac82..75b269fc0 100644 --- a/src/js/contentscript.js +++ b/src/js/contentscript.js @@ -467,7 +467,7 @@ vAPI.injectScriptlet = function(doc, text) { if ( !doc ) { return; } let script, url; try { - const blob = new self.Blob([ text ], { type: 'text/javascript' }); + const blob = new self.Blob([ text ], { type: 'text/javascript; charset=utf-8' }); url = self.URL.createObjectURL(blob); script = doc.createElement('script'); script.async = false;