Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add the "View Website" action to a timeline card?

As of firmware update XE7, Glass adds a "View Website" action to search results. How do I add this action to my own timeline cards, such that it will open the Glass Browser with an arbitrary URL?

like image 798
rymo Avatar asked Jul 02 '13 17:07

rymo


1 Answers

Add the OPEN_URI built-in menu item to your timeline item and the URL to menuItem.payload. The JSON for a timeline item might look like this:

{ 
  "text" : "Hello World!",
  "menuItems" : [{
    "action" : "OPEN_URI",
    "payload" : "http://example.com"
  }]
}

You can read more about built-in menu items on the official documentation for this feature.

like image 169
mimming Avatar answered Nov 02 '22 08:11

mimming