Skip to content

Commit

Permalink
Dispatch focus event before reading an input value
Browse files Browse the repository at this point in the history
  • Loading branch information
wolandmaster committed Dec 23, 2020
1 parent dabbff8 commit 3d3c4d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Unique Passwords",
"short_name": "unique-passwords",
"version": "1.3.0",
"version": "1.3.1",
"description": "Generate strong and unique site-specific passwords!",
"homepage_url": "https://github.com/wolandmaster/unique-passwords-firefox",
"icons": {
Expand Down
1 change: 1 addition & 0 deletions scripts/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
selector: usernameSelector
});
if (msg.action === "getUsername") {
usernameInput.dispatchEvent(new Event("focus", { bubbles: true }));
let username = usernameInput ? usernameInput.value : "";
port.postMessage({ action: "setUsername", username });
} else if (msg.action === "setUsername" && usernameInput) {
Expand Down

0 comments on commit 3d3c4d5

Please sign in to comment.