在 developer console 直接輸入

(function() {
    const origDispatchEvent = EventTarget.prototype.dispatchEvent;
    EventTarget.prototype.dispatchEvent = function(event) {
        if (event instanceof CustomEvent) {
            console.log("[Custom Event Captured]:", event.type, event.detail);
        }
        return origDispatchEvent.call(this, event);
    };
})();

補充一下

要監聽原生事件的話

monitorEvents(document);

共有 0 則留言


每週二 YT 直播問答,DC 可 Call-in,一起討論技術、職涯發展。
🏆 本月排行榜
🥇
站長阿川
📝8   💬8   ❤️13
402
🥈
我愛JS
📝1   💬6   ❤️4
88
🥉
酷豪
📝1   ❤️1
50
#4
AppleLily
📝1   💬4   ❤️1
38
#5
💬3  
10
評分標準:發文×10 + 留言×3 + 獲讚×5 + 點讚×1 + 瀏覽數÷10
本數據每小時更新一次