OUTIcomplete

Restores card number autocompletion in OUTI library login.

当前为 2017-07-05 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name OUTIcomplete
  3. // @namespace raina
  4. // @description Restores card number autocompletion in OUTI library login.
  5. // @include /^https?:\/\/koha\.outikirjastot\.fi\//
  6. // @version 1
  7. // @grant none
  8. // ==/UserScript==
  9. // jshint esversion: 6
  10. if (window.top === window.self) {
  11. let inputs = document.querySelectorAll('[name="userid"]');
  12. let mo = new MutationObserver((mutations) => {
  13. for (let mutation of mutations) {
  14. if ("autocomplete" === mutation.attributeName) {
  15. mutation.target.removeAttribute("autocomplete");
  16. mo.disconnect();
  17. }
  18. }
  19. });
  20. for (let input of inputs) {
  21. mo.observe(input, {attributes:true});
  22. }
  23. }