WazeWrapTest

Test

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/471459/1223871/WazeWrapTest.js

  1. // ==UserScript==
  2. // @name WazeWrapTest
  3. // @description Test
  4. // @include https://beta.waze.com/*editor*
  5. // @include https://www.waze.com/*editor*
  6. // @exclude https://www.waze.com/*user/editor/*
  7. // @grant GM_xmlhttpRequest
  8. // ==/UserScript==
  9.  
  10. /* global WazeWrap */
  11. /* global $ */
  12. /* jshint esversion:6 */
  13.  
  14. var WazeWrap = {};
  15.  
  16. (function() {
  17. 'use strict';
  18. const MIN_VERSION = '2019.05.01.01';
  19. const WW_URL = 'https://gf.qytechs.cn/scripts/471457-wazewrap-testing/code/WazeWrap%20Testing.js';
  20.  
  21. async function init(){
  22. const sandboxed = typeof unsafeWindow !== 'undefined';
  23. const pageWindow = sandboxed ? unsafeWindow : window;
  24. const wwAvailable = pageWindow.WazeWrap && (!pageWindow.WazeWrap.Version || pageWindow.WazeWrap.Version > MIN_VERSION);
  25.  
  26. if (wwAvailable) {
  27. WazeWrap = pageWindow.WazeWrap;
  28. } else {
  29. pageWindow.WazeWrap = WazeWrap;
  30. }
  31. if (sandboxed) window.WazeWrap = WazeWrap;
  32. if (!wwAvailable) await $.getScript(WW_URL);
  33. }
  34. function bootstrap(tries = 1) {
  35. if (typeof $ != 'undefined')
  36. init();
  37. else if (tries < 1000)
  38. setTimeout(function () { bootstrap(tries++); }, 100);
  39. else
  40. console.log('WazeWrap launcher failed to load');
  41. }
  42. bootstrap();
  43. })();

QingJ © 2025

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