Setup HTML does not work
Posted: Thu Dec 01, 2011 1:58 pm
Hi again, Juan
I have imported a premade to enter automatically user and password. The project is called autologin, and is available in the premade menu in version 2.2.5.
Without touching anything, this project does not work, for some obscure reason, the setup html page does not show up, so the javascript then cannot find the user and password data. I tried to see what was wrong, but did not notice anything in the HTML code.
Regarding the javascript code, on the opposite, I find it a little complex.
As the userBoxKind and passBoxKind are supposed to exist and be unique throughout the project, then what is the use of complicating things in allowing other kind names ?
Anyway, I'm not asking you to solve this, the issue concerning Helium scraper is : why is the setup html page not displayed upon project start up ?
Hope you can reproduce this on your side. I have attached the html code that comes with the premade here after for your convenience.
Best regards.
Pascal.
<html>
<head>
<style type="text/css">
#topDiv
{
position:absolute;
/* Helium Scraper will adjust the size of the displayed page to this size */
width:287px;
height:103px;
z-index:1;
background-color: buttonface;
padding: 8px;
}
body
{
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
</style>
<script type="text/javascript">
function addOption(selectbox, text, value)
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
function OnLoad()
{
var kindNames = window.external.KindNames();
var username = document.getElementById("username");
var password = document.getElementById("password");
var userBoxKind = document.getElementById("userBoxKind");
var passBoxKind = document.getElementById("passBoxKind");
for(k = 0; k < kindNames.length; k++)
{
addOption(userBoxKind, kindNames[k], kindNames[k]);
addOption(passBoxKind, kindNames[k], kindNames[k]);
}
if(window.external.ParamsSet)
{
userBoxKind.value = window.external.GetParam("userBoxKind");
passBoxKind.value = window.external.GetParam("passBoxKind");
username.value = window.external.GetParam("username");
password.value = window.external.GetParam("password");
}
}
</script>
</head>
<body onLoad="OnLoad()">
<div id="topDiv">
<form action="http://www.do-not-change-this.com" method="get" id="mainForm">
<!-- Place all your content here -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>User Box:</td>
<td><select name="userBoxKind" id="userBoxKind">
</select></td>
</tr>
<tr>
<td>Pass Box:</td>
<td><select name="passBoxKind" id="passBoxKind">
</select></td>
</tr>
<tr>
<td>Username:</td>
<td><input type="text" name="username" id="username"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="text" name="password" id="password"></td>
</tr>
</table>
</form>
</div>
</body>
</html>
I have imported a premade to enter automatically user and password. The project is called autologin, and is available in the premade menu in version 2.2.5.
Without touching anything, this project does not work, for some obscure reason, the setup html page does not show up, so the javascript then cannot find the user and password data. I tried to see what was wrong, but did not notice anything in the HTML code.
Regarding the javascript code, on the opposite, I find it a little complex.
As the userBoxKind and passBoxKind are supposed to exist and be unique throughout the project, then what is the use of complicating things in allowing other kind names ?
Anyway, I'm not asking you to solve this, the issue concerning Helium scraper is : why is the setup html page not displayed upon project start up ?
Hope you can reproduce this on your side. I have attached the html code that comes with the premade here after for your convenience.
Best regards.
Pascal.
<html>
<head>
<style type="text/css">
#topDiv
{
position:absolute;
/* Helium Scraper will adjust the size of the displayed page to this size */
width:287px;
height:103px;
z-index:1;
background-color: buttonface;
padding: 8px;
}
body
{
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
</style>
<script type="text/javascript">
function addOption(selectbox, text, value)
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
function OnLoad()
{
var kindNames = window.external.KindNames();
var username = document.getElementById("username");
var password = document.getElementById("password");
var userBoxKind = document.getElementById("userBoxKind");
var passBoxKind = document.getElementById("passBoxKind");
for(k = 0; k < kindNames.length; k++)
{
addOption(userBoxKind, kindNames[k], kindNames[k]);
addOption(passBoxKind, kindNames[k], kindNames[k]);
}
if(window.external.ParamsSet)
{
userBoxKind.value = window.external.GetParam("userBoxKind");
passBoxKind.value = window.external.GetParam("passBoxKind");
username.value = window.external.GetParam("username");
password.value = window.external.GetParam("password");
}
}
</script>
</head>
<body onLoad="OnLoad()">
<div id="topDiv">
<form action="http://www.do-not-change-this.com" method="get" id="mainForm">
<!-- Place all your content here -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>User Box:</td>
<td><select name="userBoxKind" id="userBoxKind">
</select></td>
</tr>
<tr>
<td>Pass Box:</td>
<td><select name="passBoxKind" id="passBoxKind">
</select></td>
</tr>
<tr>
<td>Username:</td>
<td><input type="text" name="username" id="username"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="text" name="password" id="password"></td>
</tr>
</table>
</form>
</div>
</body>
</html>