Skip to content

Debugging in the browser

All the available debugging options are available in the browser. You can enable these options using the window.Glean object.

The debugging preferences are set in the browser’s sessionStorage. Once set these options will persist until you end your current browser session.

Usage

// Log pings to the browser console.
window.Glean.setLogPings(true);
// Tag pings so that they show up in the Glean Debug Ping Viewer.
window.Glean.setDebugViewTag("example-tag");
// Tag pings with source tags.
window.Glean.setSourceTags(["my-tag", "your-tag", "our-tag"]);
// Open a new tab in the browser showing the Debug Ping Viewer with the active session in focus.
window.Glean.debugSession();

Try it out

The documentation you are currently using is instrumented with Glean.js (cool right?).

  • Right click on this page
  • Click on “Inspect”
  • Click on “Console”
  • Set a debugging option like window.Glean.setLogPings(true)
  • Reload the page

Further reading