I want to create a script in JS which would allow me to open (probably many) new windows to external sites (e.g. facebook) and autocomplete login and password (eventually - just login) with given creditentials.
Note: I don't care about security, it's just an inner-use script.
Basing on W3S I made something like:
<html>
<head>
<title></title>
</head>
<body>
<script src="open.js">
</script>
</body>
</html>
and:
var fb = window.open('https://facebook.com');
if(fb) {
fb.onload = function() {
fb.document.getElementById('email').value = 'what';
fb.document.getElementById('pass').value = 'ever';
fb.document.getElementById('loginbutton').click();
}
} else {
alert('Please allow popups for this website');
}
But all these do is open given site in a new tab.
I'm completely new to JS and HTML, so please explain like I'm five.
edit: Ok, I've learnt thet it's impossible to set external domain's values using only JS and HTML (correct me if I'm wrong). Is there any quick way (code snippet would be most appreciated) to do so? I found some info and made a user's extension to chrome (not working so don't bother pasting the code), yet still have no idea how to implement this to many new windows or generally - how tf should I do this... Any help, please?