Fix Bitwarden compatibility

Make login/password boxes on selected sites compatible with Bitwarden auto-fill

目前为 2022-07-27 提交的版本。查看 最新版本

// ==UserScript==
// @name          Fix Bitwarden compatibility
// @description   Make login/password boxes on selected sites compatible with Bitwarden auto-fill
// @author        MK
// @namespace     max44
// @homepage      https://gf.qytechs.cn/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/*
// @icon          https://vault.bitwarden.com/images/favicon-32x32.png
// @version       1.0.2
// @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);
  }

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址