Fixed unnecessary escape characters
This commit is contained in:
parent
6a11d3049a
commit
a9a45e0f20
|
@ -134,8 +134,8 @@ class WindowUtils extends Module {
|
|||
injectScript(fpath, variable) {
|
||||
console.log(`Injecting: ${fpath}`);
|
||||
|
||||
const escaped_path = fpath.replace(/\\/g, '\\\\').replace(/"/g, '\\\"');
|
||||
const escaped_variable = variable ? variable.replace(/\\/g, '\\\\').replace(/"/g, '\\\"') : null;
|
||||
const escaped_path = fpath.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
||||
const escaped_variable = variable ? variable.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : null;
|
||||
|
||||
if (variable) this.executeJavascript(`window["${escaped_variable}"] = require("${escaped_path}");`);
|
||||
else this.executeJavascript(`require("${escaped_path}");`);
|
||||
|
|
Loading…
Reference in New Issue