Skip to content

Commit

Permalink
1.6.8 Still fixing CSP
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomazPom committed Nov 30, 2024
1 parent f6fede1 commit acedd30
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 5 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -1481,6 +1481,11 @@ class uDarkC extends uDarkExtended {
if(!(value instanceof String || typeof value === "string")){
return value;
}
// if ((value.match(/\(/g) || []).length !== (value.match(/\)/g) || []).length) {
// console.error("Unbalanced parenthesis in value", key, value);
// }


let alreadyEditedTestResult = value.match("NotImplemented" + uDark.alreadyEditedTestRegex);
let key_prefix = actions.key_prefix || "";
if (alreadyEditedTestResult) {
Expand Down
2 changes: 1 addition & 1 deletion backgroundClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ class uDarkExtended extends uDarkExtendedContentScript {
}
for(let [newCSPValue,cspDirectiveKeys] of Object.entries(CSPBypass_map)){
for(let cspDirective of cspDirectiveKeys){
if(cspObject[cspDirective]){
if(cspDirective in cspObject){ // Care to use in ; as default-src can be empty, which is equivalent to 'none'
cspObject[cspDirective] = newCSPValue;
}
if(newCSPValue === "delete")
Expand Down
4 changes: 0 additions & 4 deletions contentScriptClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,13 @@ 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
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);
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.7",
"version": "1.6.8",
"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 acedd30

Please sign in to comment.