Skip to content
On this page

Notification

notify

Programmatically display a push notification popup, which when clicked may be programmed to open a new window or close.

Anything from a simple text snippet to a full fledged HTML markup can be displayed inside the notification.

Simple text

textnotify.gif


Full HTML

htmlnotify.gif



Syntax

json
{
  "method": "notify",
  "params": {
    "html": <the html content inside the notification>,
    "action": <action name>,
    "href": <the url>,
    "target": <the 'target' attribute for window.open()>,
    "features": <the 'windowFeatures' attribute for window.open()>  // "app" opens the page in pinokio,
  }
}

Examples


Move to another url

json
{
  "run": [{
    "method": "notify",
    "params": {
      "html": "Click to visit index.json",
      "href": "./index.json"
    }
  }]
}

json
{
  "run": [{
    "method": "notify",
    "params": {
      "html": "Click to open https://github.com",
      "href": "https://github.com",
      "target": "_blank"
    }
  }]
}

Close the current window

json
{
  "run": [{
    "method": "notify",
    "params": {
      "action": "close"
    }
  }]
}