A toastr notification library for WME scripts
Script này sẽ không được không được cài đặt trực tiếp. Nó là một thư viện cho các script khác để bao gồm các chỉ thị meta
// @require https://update.greasyfork.org/scripts/560385/1799612/WazeToastr.js
// ==UserScript==
// @name WazeToastr
// @namespace https://greasyfork.org/users/30701-justins83-waze
// @version 2026.04.15.09
// @description A toastr notification library for WME scripts
// @author JustinS83/MapOMatic/kid4rm90s
// @include https://beta.waze.com/*editor*
// @include https://www.waze.com/*editor*
// @exclude https://www.waze.com/*user/editor/*
// @grant GM_xmlhttpRequest
// ==/UserScript==
// Forked from WazeDev's WazeWrap script to use a more reliable CDN for displaying the alerts and the main library file.
/* global WazeToastr */
/* global $ */
/* global unsafeWindow */
/* global getWmeSdk */
/* jshint esversion:6 */
var WazeToastr = {};
(function() {
'use strict';
const WT_URL = 'https://kid4rm90s.github.io/WazeToastr/WazeToastrLib.js';
async function init(){
const sandboxed = typeof unsafeWindow !== 'undefined';
const pageWindow = sandboxed ? unsafeWindow : window;
const wtAvailable = pageWindow.WazeToastr && typeof pageWindow.WazeToastr === 'object';
if (wtAvailable) {
WazeToastr = pageWindow.WazeToastr;
} else {
pageWindow.WazeToastr = WazeToastr;
}
if (sandboxed) window.WazeToastr = WazeToastr;
if (!wtAvailable) await $.getScript(WT_URL);
}
function bootstrap(tries = 1) {
if (typeof $ != 'undefined')
init();
else if (tries < 1000)
setTimeout(function () { bootstrap(tries++); }, 100);
else
console.log('WazeToastr launcher failed to load');
}
bootstrap();
})();