I have few password protected pages on my WordPress site. To speed things up a little, using a script I found somewhere online, I created a page of buttons and labels that link to these pages. Clicking the button copies the password to the clipboard and opens the url.
The login page is a simple one edit box.
Is it possible to improve this script so that: a) wait for target page to load, b) enter the password in the edit box, and c) simulate hitting enter.
Noob here. Help would be appreciated.
Cheers
Usage:
The login page is a simple one edit box.
Is it possible to improve this script so that: a) wait for target page to load, b) enter the password in the edit box, and c) simulate hitting enter.
Noob here. Help would be appreciated.
Cheers
JavaScript:
function copyPassOpenURL(pass, url) {
navigator.clipboard.writeText(pass).then(() => {
window.open(url, '_blank').focus();
});
}
Usage:
HTML:
<button class="<CLASS>" onclick="copyPassOpenURL('<PASS>', '<URL>')"><LABEL></button>