您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Opens Street View in a new window.
// ==UserScript== // @name WME Open Street View in New Window // @namespace https://github.com/WazeDev/wme-open-sv-in-new-window // @version 0.0.1 // @description Opens Street View in a new window. // @author Gavin Canon-Phratsachack (https://github.com/gncnpk) // @match https://beta.waze.com/*editor* // @match https://www.waze.com/*editor* // @exclude https://www.waze.com/*user/*editor/* // @exclude https://www.waze.com/discuss/* // @icon https://www.google.com/s2/favicons?sz=64&domain=waze.com // @license MIT // @contributionURL https://github.com/WazeDev/Thank-The-Authors // @grant none // ==/UserScript== (function() { 'use strict'; let wmeSdk; window.SDK_INITIALIZED.then(initialize) function waitForElm(selector) { return new Promise(resolve => { if (document.querySelector(selector)) { return resolve(document.querySelector(selector)); } const observer = new MutationObserver(mutations => { if (document.querySelector(selector)) { observer.disconnect(); resolve(document.querySelector(selector)); } }); observer.observe(document.body, { childList: true, subtree: true }); }); } async function initialize() { wmeSdk = await getWmeSdk({ scriptId: 'wme-open-sv-in-new-window', scriptName: 'WME Open Street View in New Window' }) let svImg = document.createElement("img"); svImg.src = "https://upload.wikimedia.org/wikipedia/commons/e/e0/Google_Street_View_icon.svg"; svImg.style = "margin-right: 10px;margin-left: 10px;width: 22px;"; svImg.title = "Open Street View" svImg.addEventListener("click", openGoogleStreetView); waitForElm('.secondary-toolbar-actions').then((elm) => { let toolbar = document.getElementsByClassName("secondary-toolbar-actions")[0]; toolbar.insertBefore(svImg, toolbar.children[0]); }); } async function openGoogleStreetView() { let point; let link; try { point = await wmeSdk.Map.drawPoint({ snapTo: "segment" }); link = `http://maps.google.com/maps?q=&layer=c&cbll=${point.coordinates[1]},${point.coordinates[0]}` window.open(link, '_blank', 'height=540,width=960,popup'); } catch { console.log("wme-open-sv-in-new-window: User canceled draw"); } } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址