Skip to content

Commit

Permalink
Merge pull request #705 from CybercentreCanada/update/class-access
Browse files Browse the repository at this point in the history
Update/class access
  • Loading branch information
cccs-kevin authored Apr 10, 2024
2 parents 46fb77f + 6eeb3ae commit ce92aab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jsjaws.py
Original file line number Diff line number Diff line change
Expand Up @@ -2224,7 +2224,7 @@ def _set_element_attribute_script(attr_id: str, attr_val: str, random_element_va
if '"' in attr_val:
attr_val = attr_val.replace('"', '\\"')

if "\\" in attr_val:
if "\\" in attr_val and "url(" not in attr_val:
attr_val = attr_val.replace("\\", "\\\\")

return f'{random_element_varname}.setAttribute("{attr_id}", "{attr_val}");\n'
Expand Down
5 changes: 5 additions & 0 deletions tools/malwarejail/env/web/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ $ = function (thing) {
let attribute = split_selector[1];
let element = document.getElementById(id);
return element;
} else if (typeof thing === "string" && thing.indexOf(".") === 0) {
// This is a getter for the class!
let class_name = thing.replace(".", "");
let element = document.getElementById(class_name);
return element;
}
return document.getElementById(thing);
};
Expand Down

0 comments on commit ce92aab

Please sign in to comment.