Fix Gmail Link

Fixes the gmail link on www.google.com

  1. // ==UserScript==
  2. // @name Fix Gmail Link
  3. // @namespace null
  4. // @description Fixes the gmail link on www.google.com
  5. // @include https://www.google.com/?gws_rd=ssl
  6. // @include http://www.google.com/?gws_rd=ssl
  7. // @include https://www.google.com/
  8. // @include http://www.google.com/
  9. // @version 1
  10. // @grant none
  11. // ==/UserScript==
  12. document.addEventListener("DOMContentLoaded", replaceLinks, false );
  13.  
  14. if( document.readyState === "complete" ) {
  15. replaceLinks();
  16. }
  17.  
  18. function replaceLinks() {
  19. Array.forEach( document.links, function(a) {
  20. a.href = a.href.replace( "https://mail.google.com/mail/?tab=wm", "https://accounts.google.com/ServiceLogin?service=mail&continue=https://mail.google.com/mail/" );
  21. });
  22. }