Make login/password boxes on selected sites compatible with Bitwarden auto-fill
目前為
// ==UserScript==
// @name Fix Bitwarden compatibility
// @description Make login/password boxes on selected sites compatible with Bitwarden auto-fill
// @author MK
// @namespace max44
// @homepage https://greasyfork.org/en/users/309172-max44
// @match https://account.kyivstar.ua/cas/login*
// @match https://next.privat24.ua/*
// @match https://login-widget.privat24.ua/*
// @match https://auth.lifecell.ua/*
// @match https://new.novaposhta.ua/*
// @match https://otpsmart.com.ua/*
// @icon https://vault.bitwarden.com/images/favicon-32x32.png
// @version 1.0.3
// @license MIT
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @run-at document-idle
// ==/UserScript==
(function() {
'use strict';
function universalAddIdUsername(input) {
if (input.getAttribute("id") != "username") {
input.setAttribute("id", "username");
}
}
function universalAddIdPhone(input) {
if (input.getAttribute("id") != "phone") {
input.setAttribute("id", "phone");
}
}
function kyivstarAddIdPUK2(input) {
if (input.getAttribute("id") == null) {
if (window.location.href.indexOf("#puk2:") !== -1) {
input.setAttribute("id", "puk2");
}
}
}
if (window.location.href.indexOf("https://account.kyivstar.ua/cas/login") == 0) {
setInterval (function () {
document.querySelectorAll("input[type='tel']").forEach(universalAddIdUsername);
document.querySelectorAll("input[type='password']").forEach(kyivstarAddIdPUK2);
}, 500);
}
if (window.location.href.indexOf("https://login-widget.privat24.ua/") == 0) {
setInterval (function () {
document.querySelectorAll("input[type='tel']").forEach(universalAddIdUsername);
}, 500);
}
if (window.location.href.indexOf("https://auth.lifecell.ua/") == 0) {
setInterval (function () {
document.querySelectorAll("input[autocomplete='username'][inputmode='tel']").forEach(universalAddIdUsername);
}, 500);
}
if (window.location.href.indexOf("https://new.novaposhta.ua/") == 0) {
setInterval (function () {
document.querySelectorAll("input.mat-input-element").forEach(universalAddIdPhone);
}, 500);
}
if (window.location.href.indexOf("https://otpsmart.com.ua/") == 0) {
setInterval (function () {
document.querySelectorAll("input#userNameVisual").forEach(universalAddIdUsername);
}, 500);
}
})();