WME Waze Object Fixer

This script fixes the various scripts that rely on the deprecated Waze JavaScript object. Make sure this script is executed before all other scripts.

  1. // ==UserScript==
  2. // @name WME Waze Object Fixer
  3. // @namespace http://www.tomputtemans.com/
  4. // @description This script fixes the various scripts that rely on the deprecated Waze JavaScript object. Make sure this script is executed before all other scripts.
  5. // @include /^https:\/\/(www|beta)\.waze\.com\/(?!user\/)(.{2,6}\/)?editor.*$/
  6. // @version 0.1
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12. function init() {
  13. if (typeof Waze === 'undefined' && typeof W === 'undefined') { // Shouldn't ever happen, but still...
  14. setTimeout(init, 100);
  15. return;
  16. }
  17. if (typeof Waze === 'undefined') {
  18. window.Waze = W;
  19. console.log('Waze Object Fixer has added the Waze object back again');
  20. }
  21. }
  22. init();
  23. })();