Fixed unnecessary escape characters

This commit is contained in:
Samuel Elliott 2018-02-13 20:11:34 +00:00
parent 6a11d3049a
commit a9a45e0f20
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
1 changed files with 2 additions and 2 deletions

View File

@ -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}");`);