3 <meta charset=
"utf-8" />
8 function receiveMessage(event
){
9 if (event
.data
== "fill_and_submit") {
10 document
.getElementById("username").value
= "temp";
11 document
.getElementById("password").value
= "pa55w0rd";
12 document
.getElementById("submit_button").click();
13 } else if (event
.data
== "get_username") {
14 event
.source
.postMessage(document
.getElementById("username").value
,
16 } else if (event
.data
== "get_password") {
17 event
.source
.postMessage(document
.getElementById("password").value
,
21 window
.addEventListener("message", receiveMessage
, false);
24 <form method=
"POST" name=
"TestForm" action=
"/password/done.html">
25 <input type=
"text" id=
"username"/>
26 <input type=
"password" id=
"password"/>
27 <input type=
"submit" id=
"submit_button" value=
"Log"/>