您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Notfication test for https://www.google.com/
// ==UserScript== // @name Notfication test // @version 0.1 // @description Notfication test for https://www.google.com/ // @author epicdude2121 // @grant none // @license MIT // @match https://www.google.com/ // @grant GM_notification // @run-at document-end // @namespace https://www.google.com/ // ==/UserScript== function notifyMe() { // Let's check if the browser supports notifications if (!("Notification" in window)) { console.log("This browser does not support desktop notification"); } // Let's check whether notification permissions have already been granted else if (Notification.permission === "granted") { // If it's okay let's create a notification var notification = new Notification("Put wutever here!"); } // Otherwise, we need to ask the user for permission else if (Notification.permission !== 'denied' || Notification.permission === "default") { Notification.requestPermission(function (permission) { // If the user accepts, let's create a notification if (permission === "granted") { var notification = new Notification("Put wutever here!"); } }); } // At last, if the user has denied notifications, and you // want to be respectful there is no need to bother them any more. }