Published
Edited
Sep 4, 2019
Importers
3 stars
Insert cell
Insert cell
Insert cell
Object.keys(window)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// require("hyperhtml")
Insert cell
// This cell just filters out the default junk, depending on the detected browser
nonDefaultGlobals = Object.keys(window).filter(str => {
const UA = navigator.userAgent;
let filter;
if (UA.includes('Firefox'))
filter = defaultWindowFirefox;
else if (UA.includes('Edge'))
filter = defaultWindowEdge;
else if (UA.includes('Chrome'))
filter = defaultWindowChrome;
else if (UA.includes('Safari'))
filter = defaultWindowSafari;
else // browser not yet added to this notebook, sorry!
filter = '';
if (UA.includes('Windows'))
filter.push("onvrdisplayconnect","onvrdisplaydisconnect","onvrdisplayactivate",
"onvrdisplaydeactivate","onvrdisplaypresentchange");
if (UA.includes('Mobile')) // any other mobile-only properties / methods?
filter.push('orientation');
return !filter.includes(str);
})
Insert cell
Insert cell
// md`\`\`\`js
// function
// \`\`\``
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more