您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Play sound and change button style when a new notification arrives in Zendesk.
- // ==UserScript==
- // @name Zendesk Notification Sound & Highlight Updated
- // @namespace https://yourdomain.com
- // @version 3.0
- // @description Play sound and change button style when a new notification arrives in Zendesk.
- // @author KoKa_UA
- // @match *://*.zendesk.com/*
- // @grant GM_addStyle
- // @license MIT
- // ==/UserScript==
- (function() {
- 'use strict';
- const notificationSound = new Audio("https://zvukitop.com/wp-content/uploads/2021/03/zvuki-opovesheniya.mp3");
- function checkForNewMessages(mutationsList) {
- const unreadCountElement = document.querySelector('[data-test-id="awm-unread-count"]');
- const notificationButton = document.querySelector('button[aria-label="Notifications"]');
- if (unreadCountElement && notificationButton) {
- if (unreadCountElement.innerText.trim() !== "0" && unreadCountElement.innerText.trim() !== "") {
- notificationSound.play();
- notificationButton.classList.add("has-new-messages");
- } else {
- notificationButton.classList.remove("has-new-messages");
- }
- }
- }
- function startObserver() {
- const targetNode = document.body;
- const config = { childList: true, subtree: true };
- const observer = new MutationObserver(checkForNewMessages);
- observer.observe(targetNode, config);
- }
- window.addEventListener('load', function() {
- setTimeout(startObserver, 5000);
- });
- })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址