Tampermonkey: GM_notification timeout problem

Created on 8 May 2019  路  11Comments  路  Source: Tampermonkey/tampermonkey

Using Chrome:

Timeout 30000 hidding with approximately 7 seconds.

Code:

javascript GM_notification ({ text: 'Test notification body.', title: 'Test notice title', //highlight: true, timeout: 30000, onclick: function () { console.log("Notice clicked."); window.focus(); } });

bug fixed at beta

Most helpful comment

Fixed at TM BETA 4.9.5960. "requireInteraction" is now set where ever possible.

All 11 comments

What is your OS version?

Version 74.0.3729.131 (Official Build) (64-bit)

What is your Windows, MacOS or Linux version?

windows

image

Just for test:

// ==UserScript==
// @name         foo
// @namespace    http://fabianolothor.com.br/
// @version      1.0.0
// @description  Global
// @author       Fabiano (Lothor)
// @match        *://*/*
// @grant        GM_notification
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_deleteValue
// ==/UserScript==
(function() {
    GM_notification({text: "this is a test", timeout: 30000});
})();

Is it some setting on my Chrome or TamperMonkey?

I make a test in a linux machine and the problem is the same.

I see the problem!

Timeout works fine if my mouse is it hover the notification.

If the mouse is not focusing the notification, its just hide after approximately 7 ~ 10 seconds.

You can add this parameter: https://web-push-book.gauntface.com/chapter-05/03-notification-behaviour/#requires-interaction

The timeoutis working fine, and when it is less the 7000 or 10000 miliseconds the problem is not perceptible.

So, with the requires-interaction until the timeout ended the notification will appear on the screen.

I solve my problem for now: https://pushjs.org/

// @require https://pushjs.org/scripts/push.min.js

Fixed at TM BETA 4.9.5960. "requireInteraction" is now set where ever possible.

Was this page helpful?
0 / 5 - 0 ratings