beep

beeps when a tag's attributes changes.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         beep
// @namespace    https://greasyfork.org/en/users/827932-letsgo0
// @version      0.2
// @description  beeps when a tag's attributes changes.
// @author       Mr Chen
// @match        http://*.chinaeast2.cloudapp.chinacloudapi.cn/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const div = document.createElement('div');
    div.style.cssText = 'visibility: hidden;';
    div.innerHTML = `<audio id="beep" src="https://cdn.jsdelivr.net/gh/letsgo0/shareF@main/voi.mp3">not supported!</audio>`;
    document.body.appendChild(div);

    const target = document.querySelector("#captchaWhole");
    // create an observer instance
    var observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            if (mutation.type === 'attributes'){
                const target = mutation.target;
                if (target.style.cssText === ""){
                    // beep
                    // console.log('beep');
                    const beep = document.querySelector('#beep');
                    beep.play();
                }
            }
        });
    });

    // configuration of the observer:
    var config = { attributes: true, childList: false, characterData: false }

    // pass in the target node, as well as the observer options
    observer.observe(target, config);

    // later, you can stop observing
    // observer.disconnect();
})();