Glass Dev: What HTML Elements are Allowed or Blocked in Mirror API

Google Glass’ Mirror API is a pretty simple and straightforward way of making Glassware and it uses web technologies, which makes it accessible by a lot of web developers. Mirror API uses HTML, but you cannot use just any HTML element, because it comes with some restrictions.

Some HTML elements are allowed, which means you can freely use them, while others are ignored, meaning that only their content will be seen, without any styling the element might come with. And the 3rd category, blocked elements, means that both the element and its contents will be removed.

Google Glass Mirror API mostly allows only basic styling and structuring elements, while it removes head, embeds, frames, scripts and anything like that. Below you can see a list of both allowed and removed elements.

Allowed HTML elements

These elements are allowed and they will work exactly as they should

  • Headers: h1, h2, h3, h4, h5, h6
  • Images: img
  • Lists: li, ol, ul
  • HTML5 semantics: article, aside, details, figure, figcaption, footer, header, nav, section, summary, time
  • Structural: blockquote, br, div, hr, p, span
  • Style: b, big, center, em, i, u, s, small, strike, strong, style, sub, sup
  • Tables: table, tbody, td, tfoot, th, thead, tr

Blocked HTML elements

These elements will be removed, along with all their contents. Don’t try to use them, because it’s useless.

  • Document headers: head, title
  • Embeds: audio, embed, object, source, video
  • Frames: frame, frameset
  • Scripting: applet, script

Other elements

Any other elements that’s not included in the two lists above will be removed, but its content will remain, being unstyled. This means you shouldn’t use it, because it will simply be ignored.