Allow password pasting

Re-enables password pasting on Ebay and pobably other sites.

  1. // ==UserScript==
  2. // @name Allow password pasting
  3. // @namespace none
  4. // @description Re-enables password pasting on Ebay and pobably other sites.
  5.  
  6. // @include *
  7. // @exclude https?://.*?.facebook.com/.*
  8. // @exclude https?://.*?.google.com/.*
  9. // @exclude https?://.*?.?github.com/.*
  10. // @exclude https?://imgur.com/.*
  11.  
  12. // @run document-end
  13.  
  14. // @author lukie80
  15. // @copyright Creative Commons Attribution-ShareAlike 3.0 Unported (CC-BY-SA 3.0)
  16. // @license http://creativecommons.org/licenses/by-sa/3.0/
  17. // @version 1.0
  18. // @lastupdated 2016.09.20
  19. //
  20. // ==/UserScript==
  21. //-------------------------------------------------------------------------------------------------------------------
  22.  
  23. // Code taken from "Chris' blog":
  24. // http://chrisbailey.blogs.ilrt.org/2013/01/03/re-enabling-password-pasting-on-annoying-web-forms-v2/
  25. // The only solution that works so far.
  26.  
  27. var inputs = document.getElementsByTagName('input');
  28. for (var i=0; i < inputs.length; i++) {
  29. if (inputs[i].getAttribute('type').toLowerCase() === 'password') {
  30. inputs[i].onpaste = function(e) {
  31. // only Chrome and Safari support clipboardData access on event object
  32. // see http://codebits.glennjones.net/editing/getclipboarddata.htm
  33. if (e.clipboardData != undefined && e.clipboardData.getData != undefined)
  34. {
  35. this.value = e.clipboardData.getData('text/plain');
  36. }
  37. return false;
  38. }
  39. }
  40. }
  41.  
  42.  
  43. //-------------------------------------------------------------------------------------------------------------------

QingJ © 2025

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