呀嘻耶耶 发表于 2023-2-11 21:57:33

关于GM_notification函数的问题

// ==UserScript==
// @name New Userscript
// @namespace https://bbs.tampermonkey.net.cn/
// @version 0.1.0
// @description try to take over the world!
// @author You
// @match \*
// @grant GM\_notification
// @run-at document-end
// ==/UserScript==

(function () {
'use strict';
function doit(message) {
GM\_notification({
title: location.host,
text: message,
timeout: 2000,
highlight: false,
})
}

```
setTimeout(() => {
    doit("123123")
    console.log('提示!')
}, 2000)

// Your code here...
```

})();

大佬们看下这里为何没有弹出提示🤕

Su. 发表于 2023-2-12 00:01:41

!(data/attachment/forum/202302/12/000127mr88r8qbhr8r5r1r.png)
有啊

呀嘻耶耶 发表于 2023-2-12 08:45:14

Su. 发表于 2023-2-12 00:01
!(data/attachment/forum/202302/12/000127mr88r8qbhr8r5r1r.png)
有啊

我换了一台电脑也有提示了{:4_89:},是不是跟电脑环境配置有关系

王一之 发表于 2023-2-12 22:10:22

呀嘻耶耶 发表于 2023-2-12 08:45
我换了一台电脑也有提示了,是不是跟电脑环境配置有关系

是的,可能没给浏览器通知权限
页: [1]
查看完整版本: 关于GM_notification函数的问题