diff --git a/background.js b/background.js index 04d1bf1..fc072cd 100644 --- a/background.js +++ b/background.js @@ -984,7 +984,10 @@ class uDarkC extends uDarkExtended { } edit_str(strO, cssStyleSheet, verifyIntegrity = false, details, options = {}) { - + if(!strO){ // Avoiding errors when strO is null, especially in frontEnd + return new String().valueOf(); // Return an empty string to avoid errors in our own code + } + let str = strO; if (false && strO.includes("/*!sc*/")) { // TODO: Fix thins in abetter way; this is a temporary and specific fix; diff --git a/backgroundClass.js b/backgroundClass.js index f94fa5e..bef817c 100644 --- a/backgroundClass.js +++ b/backgroundClass.js @@ -357,7 +357,7 @@ class uDarkExtended extends uDarkExtendedContentScript { let key = element.slice(0, spIndex); let value = " "; value = element.slice(spIndex + 1); - uDark.log("CSP", key, value,spIndex); + // uDark.log("CSP", key, value,spIndex); cspObject[key] = value.trim(); }); let CSPBypass_map = { diff --git a/contentScriptClass.js b/contentScriptClass.js index a503f9d..f2bf6be 100644 --- a/contentScriptClass.js +++ b/contentScriptClass.js @@ -178,6 +178,8 @@ class uDarkExtendedContentScript { }, (attribute, value ) => attribute.toLowerCase() == "style") uDark.valuePrototypeEditor(HTMLImageElement, "src", (image, value) => { + console.warn("Image src set", image, value); + console.table({value,ret:uDark.image_element_prepare_href(image, document, value)}); let res = uDark.image_element_prepare_href(image, document, value); return res; }, @@ -185,7 +187,13 @@ class uDarkExtendedContentScript { //Aftermath: none false, (image, value) => { // Edited getter, to trick websites that are checking src integrity after setting it - return value.split(new RegExp("#?"+uDark.imageSrcInfoMarker))[0]; + console.warn("Image src get", image, value); + console.table({src:image.o_ud_src, value,ret:value.split(new RegExp("#?"+uDark.imageSrcInfoMarker))[0]}); + let returnVal = value.split(new RegExp("#?"+uDark.imageSrcInfoMarker))[0]; + if(returnVal.startsWith("https://data-image/?base64IMG=")) { + returnVal = returnVal.slice(30); + } + return returnVal; } ); diff --git a/manifest.json b/manifest.json index 1fad78b..54cd8f6 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "UltimaDark", - "version": "1.6.6", + "version": "1.6.7", "description": "The extension uses agressive techniques to get a dark mode everywhere on internet\nThis is still highly experimental so it can also ruin your internet experience", "homepage_url": "https://github.com/ThomazPom/Moz-Ext-UltimaDark", "icons": {