forked from j62/ctbrec
Escape passwords before injecting them
Escape quotes in passwords before injecting them into the external browser, so that the injected javascript is valid and doesn't break
This commit is contained in:
parent
7462d68d7b
commit
d96b9a1380
|
@ -63,6 +63,7 @@ public class BongaCamsElectronLoginDialog {
|
|||
}
|
||||
String password = Config.getInstance().getSettings().bongaPassword;
|
||||
if (password != null && !password.trim().isEmpty()) {
|
||||
password = password.replace("'", "\\'");
|
||||
browser.executeJavaScript("$('input[name=\"log_in[password]\"]').attr('value','" + password + "')");
|
||||
}
|
||||
String[] simplify = new String[] {
|
||||
|
|
|
@ -62,6 +62,7 @@ public class Cam4ElectronLoginDialog {
|
|||
}
|
||||
String password = Config.getInstance().getSettings().cam4Password;
|
||||
if (password != null && !password.trim().isEmpty()) {
|
||||
password = password.replace("'", "\\'");
|
||||
browser.executeJavaScript("document.querySelector('#loginPageForm input[name=\"password\"]').value = '" + password + "';");
|
||||
}
|
||||
browser.executeJavaScript("document.getElementById('footer').setAttribute('style', 'display:none');");
|
||||
|
|
|
@ -60,6 +60,7 @@ public class LiveJasminElectronLoginDialog {
|
|||
}
|
||||
String password = Config.getInstance().getSettings().livejasminPassword;
|
||||
if (password != null && !password.trim().isEmpty()) {
|
||||
password = password.replace("'", "\\'");
|
||||
browser.executeJavaScript("document.querySelector('#login_form input[name=\"password\"]').value = '" + password + "';");
|
||||
}
|
||||
browser.executeJavaScript("document.getElementById('header_container').setAttribute('style', 'display:none');");
|
||||
|
|
|
@ -84,6 +84,7 @@ public class ShowupElectronLoginDialog {
|
|||
}
|
||||
String password = Config.getInstance().getSettings().showupPassword;
|
||||
if (password != null && !password.trim().isEmpty()) {
|
||||
password = password.replace("'", "\\'");
|
||||
browser.executeJavaScript("$('input[name=\"password\"]').attr('value','" + password + "')");
|
||||
}
|
||||
browser.executeJavaScript("$('input[name=\"remember\"]').attr('value','true')");
|
||||
|
|
|
@ -62,6 +62,7 @@ public class StripchatElectronLoginDialog {
|
|||
}
|
||||
String password = Config.getInstance().getSettings().stripchatPassword;
|
||||
if (password != null && !password.trim().isEmpty()) {
|
||||
password = password.replace("'", "\\'");
|
||||
browser.executeJavaScript("document.querySelector('#login_password').value = '" + password + "';");
|
||||
}
|
||||
browser.executeJavaScript("document.querySelector('#recaptcha-checkbox-border').click();");
|
||||
|
|
Loading…
Reference in New Issue