Waze Auto Apply (Direction Tab)

Automatically clicks "Apply" after pressing Enter when naming streets or house numbers in the Direction tab of the Waze editor. Supports various languages for the "Apply" button.

目前为 2024-09-06 提交的版本。查看 最新版本

// ==UserScript==
// @name         Waze Auto Apply (Direction Tab)
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Automatically clicks "Apply" after pressing Enter when naming streets or house numbers in the Direction tab of the Waze editor. Supports various languages for the "Apply" button.
// @author       Astheron
// @match        https://www.waze.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

/**
 * License and Credits:
 *
 * This script is licensed under the MIT License:
 *
 * Copyright (c) 2024 Astheron
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this script and associated documentation files (the "Script"), to deal
 * in the Script without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Script, and to permit persons to whom the Script is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Script.
 *
 * THE SCRIPT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SCRIPT OR THE USE OR OTHER DEALINGS IN THE
 * SCRIPT.
 *
 * **Contact:** For more details or inquiries, you can contact the author, Astheron, on the Waze forum.
 */

(function() {
    'use strict';

    document.addEventListener('keydown', function(event) {
        if (event.key === 'Enter' &&
            !(document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA')) {
            event.preventDefault();

            function findApplyButton() {
                const buttons = document.querySelectorAll('button');
                for (const button of buttons) {
                    const text = button.textContent.trim().toLowerCase();
                    if (text.includes('apply') ||
                        text.includes('aplicar') ||
                        text.includes('appliquer') ||
                        text.includes('anpassen') ||
                        text.includes('应用') ||
                        text.includes('aplicare') ||
                        text.includes('aplicare') ||
                        text.includes('aplicação') ||
                        text.includes('benutzerdefinieren') ||
                        text.includes('laadige') ||
                        text.includes('使应用') ||
                        text.includes('добавить') ||
                        text.includes('править') ||
                        text.includes('补丁') ||
                        text.includes('החל') ||
                        text.includes('αναβάθμιση') ||
                        text.includes('الحفظ') ||
                        text.includes('valider') ||
                        text.includes('застосувати') ||
                        text.includes('начать') ||
                        text.includes('sauvegarder') ||
                        text.includes('guardar') ||
                        text.includes('저장') ||
                        text.includes('بريد') ||
                        text.includes('保存') ||
                        text.includes('登録') ||
                        text.includes('успешно') ||
                        text.includes('保存する') ||
                        text.includes('保存して終了') ||
                        text.includes('финиш') ||
                        text.includes('موافق') ||
                        text.includes('stellen') ||
                        text.includes('simpan') ||
                        text.includes('se salvar') ||
                        text.includes('installeren')) { 
                        return button;
                    }
                }
                return null;
            }

            let applyButton = findApplyButton();
            if (applyButton) {
                applyButton.click();
            }
        }
    }, true);
})();

QingJ © 2025

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