6

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?

rymo
  • 3,285
  • 2
  • 36
  • 40

1 Answers1

5

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.

mimming
  • 13,974
  • 3
  • 45
  • 74
  • 1
    Thanks, Jenny. [Issue 137: Make "View Website" a built-in menu action](https://code.google.com/p/google-glass-api/issues/detail?id=137) – rymo Jul 02 '13 at 18:13
  • Well, it's documented as part of https://developers.google.com/glass/v1/reference/timeline/insert under menuItems[].action = VIEW_WEBSITE so does XE7 not support handling those? – Roberto Andrade Aug 31 '13 at 17:01