Interface VMScriptGMNotificationOptions

interface VMScriptGMNotificationOptions {
    image?: string;
    onclick?: (() => void);
    ondone?: (() => void);
    silent?: boolean;
    tag?: string;
    text: string;
    title?: string;
    zombieTimeout?: number;
    zombieUrl?: string;
}

Properties

image?: string

URL of an image to show in the notification.

onclick?: (() => void)

Callback when the notification is clicked by user.

Type declaration

    • (): void
    • Returns void

ondone?: (() => void)

Callback when the notification is closed, either by user or by system.

Type declaration

    • (): void
    • Returns void

silent?: boolean

No sounds/vibrations when showing the notification.

Since

VM2.15.2, Chrome 70.

tag?: string

Unique name of the notification, e.g. 'abc', same as the web Notification API. Names are scoped to each userscript i.e. your tag won't clash with another script's tag. The purpose of a tagged notification is to replace an older notification with the same tag, even if it was shown in another tab (or before this tab was navigated elsewhere and your notification had zombieTimeout).

Since

VM2.15.4

text: string

Main text of the notification.

title?: string

Title of the notification.

zombieTimeout?: number

Number of milliseconds to keep the notification after the userscript "dies", i.e. when its tab or frame is reloaded/closed/navigated. If not specified or invalid, the default behavior is to immediately remove the notifications.

Since

VM2.15.4

zombieUrl?: string

URL to open when a zombie notification is clicked, see zombieTimeout for more info.

Since

VM2.16.1