Advertisement
Guest User

boardraider

a guest
Feb 12th, 2009
1,422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name          Login problem workaround (arcor/freenet)
  3. // @namespace     boardraider@firefox-browser.de
  4. // @description   Removes fake password input fields
  5. // @version       0.1
  6. // @date          2009-02-12
  7. // @copyright     2009, boardraider
  8. // @license       GPL 2 or later
  9. // @include       http://www.arcor.de/index.html
  10. // @include       https://www.arcor.de/login/login.jsp?*
  11. // @include       http://www.freenet.de/freenet/
  12. // ==/UserScript==
  13. //
  14. // -----------------------------------------------------------------------------
  15. //
  16. // This program is free software; you can redistribute it and/or modify
  17. // it under the terms of the GNU General Public License as published by
  18. // the Free Software Foundation; either version 2 of the License, or
  19. // (at your option) any later version.
  20. //
  21. // This program is distributed in the hope that it will be useful,
  22. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24. // GNU General Public License for more details.
  25. //
  26. // You should have received a copy of the GNU General Public License
  27. // along with this program.  If not, see <http://www.gnu.org/licenses/>.
  28. //
  29. // -----------------------------------------------------------------------------
  30. (function () {
  31.  
  32. var href = window.location.href;
  33. var formName, fakeValue;
  34.  
  35. if (href == "http://www.arcor.de/index.html"||
  36.     href.indexOf("https://www.arcor.de/login/login.jsp?") == 0) {
  37.   formName = "login";
  38.   fakeValue = "Online-Passwort";
  39. }
  40.  
  41. if (href == "http://www.freenet.de/freenet/") {
  42.   formName = "loginform";
  43.   fakeValue = "Passwort";
  44. }
  45.  
  46. var passInput = document.evaluate("//form[@name = '" + formName + "']" +
  47.   "//input[@type = 'password']", document, null,
  48.   XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  49. passInput.style.display = "block";
  50. var fakeInput = document.evaluate("//form[@name = '" + formName + "']" +
  51.   "//input[@value = '" + fakeValue + "']", document, null,
  52.   XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue
  53. passInput.parentNode.removeChild(fakeInput);
  54.  
  55. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement