Skip to content

Commit

Permalink
Fixed a couple of bugs
Browse files Browse the repository at this point in the history
You couldn't type into the site password field when trying to provide your own password.

The phishing message was wrong in two places.  In one it said the existing site was undefined.  In the other it reversed the order of the existing and requesting sites.
  • Loading branch information
alanhkarp committed Oct 24, 2023
1 parent 57d1d83 commit eed96a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ <h1 id="SitePasswordWeb">Site Password</h1>
</div>
<div id="results">
<div id="pwok" class="form-row">
<input id="sitepw" class="fixed" disabled type="text" value=""
<input id="sitepw" class="fixed" readonly type="text" value=""
placeholder="Generated site password" title="Site Password" />
<label for="sitepw" class="label">
Site password
Expand Down
13 changes: 5 additions & 8 deletions src/ssp.js
Original file line number Diff line number Diff line change
Expand Up @@ -686,11 +686,12 @@ let SitePasswordWeb = ((function (self) {
let $bkmkDomain = get("bkmkDomain");
$bkmkDomain.onpaste = function () {
setTimeout(() => {
if (parseDomain($bkmkDomain.value) === $domainname.value) {
let domainname = parseDomain(normalize($bkmkDomain.value));
if (domainname === $domainname.value) {
phishingWarningOff();
} else {
const settings = SitePassword.loadSettings($sitename.value);
phishingWarningMsg($bkmkDomain.value);
phishingWarningMsg(domainname);
phishingWarningOn(settings);
}
get("bkmkcheck").style.display = "none";
Expand All @@ -707,10 +708,6 @@ let SitePasswordWeb = ((function (self) {
}
function phishingWarningOn(settings) {
httpWarningOff();
const domainname = $domainname.value;
const sitename = settings.sitename;
let testDomain = SitePassword.validateDomain(domainname, sitename);
phishingWarningMsg(testDomain);
$phishing.style.display = "block";
$results.style.display = "none"; // hide sitepw/remember/settings...
$domainname.classList.add("bad-input");
Expand Down Expand Up @@ -743,8 +740,8 @@ let SitePasswordWeb = ((function (self) {
function phishingWarningMsg(testDomain) {
let sitename = normalize($sitename.value);
get("phishingtext0").innerText = sitename;
get("phishingtext1").innerText = testDomain;
get("phishingtext2").innerText = get("domainname").value;
get("phishingtext1").innerText = $domainname.value;
get("phishingtext2").innerText = testDomain;
}
get("forgetbutton").onclick = function () {
let children = get("toforgetlist").children;
Expand Down

0 comments on commit eed96a7

Please sign in to comment.