Google Maps Classic

Google Maps never seems to remember my preference for Classic

目前为 2015-04-09 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Google Maps Classic
  3. // @namespace http://compressedtime.com/
  4. // @version 0.1
  5. // @description Google Maps never seems to remember my preference for Classic
  6. // @match http://maps.google.com/*
  7. // @match https://maps.google.com/*
  8. // @match http://www.google.com/maps*
  9. // @match https://www.google.com/maps*
  10. // @copyright 2012+, You
  11. // @run-at document-start
  12. // ==/UserScript==
  13.  
  14. if(typeof GM_log == 'undefined')
  15. GM_log = console.log;
  16.  
  17. //GM_log("typeof document.documentElement.outerHTML=" + typeof document.documentElement.outerHTML);
  18. //GM_log("document.documentElement.outerHTML=" + document.documentElement.outerHTML);
  19.  
  20. var location = window.location.href;
  21. if(location.match(/maps\//))
  22. {
  23. // just adding output=classic to these URLs doesn't fix it
  24. return;
  25. }
  26.  
  27. // XXX try to detect if we're already on classic
  28. if(false && document.documentElement.outerHTML.match(/html class="no-maps-mini"/))
  29. {
  30. /* we're already on classic */
  31. GM_log("Google Maps Classic: looks like we're already on classic");
  32. }
  33.  
  34.  
  35. if(!location.match(/output=classic/))
  36. {
  37. window.location.href = window.location.href + '&output=classic';
  38. }