Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save AlCalzone/7c3fcb08d7c9eaccacbf768be9d4f3f0 to your computer and use it in GitHub Desktop.

Select an option

Save AlCalzone/7c3fcb08d7c9eaccacbf768be9d4f3f0 to your computer and use it in GitHub Desktop.
Tampermonkey script to make login page on https://sdomembers.z-wavealliance.org/ password manager friendly
// ==UserScript==
// @name Make Z-Wave Alliance Member Login accessible for 1Password
// @namespace http://tampermonkey.net/
// @version 2025-11-13
// @description ...because it does not work out of the box
// @author AlCalzone
// @match https://sdomembers.z-wavealliance.org/LoginPage*
// @run-at document-end
// @icon https://www.google.com/s2/favicons?sz=64&domain=z-wavealliance.org
// @grant none
// ==/UserScript==
(function() {
'use strict';
const form = document.querySelector('#Form');
const aspUser = document.querySelector('input[type="text"][name$="txtUserName"]');
const aspPass = document.querySelector('input[type="password"][name$="txtPassword"]');
if (!form || !aspUser || !aspPass) return;
// Better hints for 1Password
aspUser.setAttribute('autocomplete', 'username');
aspPass.setAttribute('autocomplete', 'current-password');
// --- Create hidden “standard” fields (used by 1Password) ---
let mirrorUser = form.querySelector('input[name="username"]');
if (!mirrorUser) {
mirrorUser = document.createElement('input');
mirrorUser.type = 'text';
mirrorUser.name = 'username';
mirrorUser.autocomplete = 'username';
mirrorUser.style.position = 'absolute';
mirrorUser.style.left = '-9999px';
mirrorUser.tabIndex = -1;
form.appendChild(mirrorUser);
}
let mirrorPass = form.querySelector('input[name="password"]');
if (!mirrorPass) {
mirrorPass = document.createElement('input');
mirrorPass.type = 'password';
mirrorPass.name = 'password';
mirrorPass.autocomplete = 'current-password';
mirrorPass.style.position = 'absolute';
mirrorPass.style.left = '-9999px';
mirrorPass.tabIndex = -1;
form.appendChild(mirrorPass);
}
// Mirror fake input fields into real ones
mirrorUser.addEventListener('input', () => {aspUser.value = mirrorUser.value;});
mirrorPass.addEventListener('input', () => {aspPass.value = mirrorPass.value;});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment