GM.notification

From GreaseSpot Wiki
Revision as of 13:41, 16 July 2018 by Lil Devil (talk | contribs) (fix description)
Jump to navigationJump to search

Description

This method displays a notification to the user, using the underlying operating system's notification mechanism.

Syntax

function GM.notification( text, title, image, onclick )

Compatibility: Greasemonkey 4.0+

Arguments

text
String The main notification text.
title
String The title of the notification.
image
String Optional: The URL for an image to display in the dialog. If not provided, the Greasemonkey logo by default.
onclick
Function Optional: callback, triggered when the notification's button is clicked.

Returns

undefined

Examples

GM.notification("A new widget is available at the frobber.", "New widget!");

The appearance is platform specific, but could be for example: