Skip to content

Commit

Permalink
1.6.7 Fixing 2 bugs frontend side
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomazPom committed Nov 28, 2024
1 parent 94de832 commit f6fede1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion backgroundClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
10 changes: 9 additions & 1 deletion contentScriptClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,22 @@ 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;
},
false, // Condition: Inconditional
//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;
}

);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit f6fede1

Please sign in to comment.