GM.notification: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
(Created page with "== Description == This method opens the specified URL in a new tab. == Syntax == {{Function|GM.notification|text, title, image, onclick}} Compatibility: Version_history#...")
(No difference)

Revision as of 16:25, 18 April 2018

Description

This method opens the specified URL in a new tab.

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: