您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds WhatsApp button to phones in Google Maps
// ==UserScript== // @name WhatsApp On Google Maps // @name:es WhatsApp En Google Maps // @namespace http://tampermonkey.net/ // @version 1.2 // @description Adds WhatsApp button to phones in Google Maps // @description:es Agrega un boton de WhatsApp a los teléfonos en Google Maps // @author JuaniElias // @match https://www.google.com/maps* // @match https://maps.google.com/maps* // @icon https://www.google.com/images/branding/product/ico/maps15_bnuw3a_32dp.ico // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to detect phone number and add WhatsApp button function addWhatsAppButton() { const areaCode = '1'; let numberNoZero; // Looks for phone number in the sidebar (adjust selector as needed) const phoneButton = document.querySelector('button[data-item-id^="phone:tel:"]'); if (!phoneButton || phoneButton.dataset.hasWhatsAppButton) return; const phoneElement = phoneButton.parentElement; const phoneMatch = phoneElement.textContent.match(/\+?\d[\d\s()-]{7,}/); if (!phoneMatch) return; let number = phoneMatch[0].replace(/[\s()-]/g, ''); if(number.charAt(0) === '0') numberNoZero = number.substring(1); let whatsapp = areaCode + numberNoZero; const btn = document.createElement('a'); btn.className = 'whatsapp-btn'; btn.href = `https://wa.me/${whatsapp}`; btn.target = '_blank'; btn.textContent = '📞 WhatsApp'; btn.style.display = 'inline-block' btn.style.marginLeft = '22px'; btn.style.backgroundColor = '#25D366'; btn.style.textDecoration = 'none'; btn.style.fontWeight = 'bold'; btn.style.borderRadius = '15px'; btn.style.padding = '5px'; btn.style.color = 'transparent'; btn.style.textShadow = '0 0 0 white'; phoneElement.insertAdjacentElement('afterend', btn); phoneButton.dataset.hasWhatsAppButton = true; } // Start observing const observer = new MutationObserver(() => { addWhatsAppButton(); }); observer.observe(document.body, { childList: true, subtree: true }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址