我正在尝试让我的 Tampermonkey 脚本显示 Chrome 通知,但没有显示通知。我已允许在网站上发送通知。
这是我的代码:
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match somewebsite.com/*
// @grant GM_notification
// @require http://code.jquery.com/jquery-1.12.4.min.js
// ==/UserScript==
(function ($, undefined) {
$(function () {
GM_notification({title: 'foo', image: 'bar', text: '42', onclick: console.log});
});
})(window.jQuery.noConflict(true));
Run Code Online (Sandbox Code Playgroud)
我需要改变什么?