Skip to content

Commit

Permalink
Merge pull request #1770 from rosahbruno/1855392-window-debugging-opt…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
rosahbruno authored Sep 27, 2023
2 parents 0c1d46e + e3fdd65 commit 6160f5e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[Full changelog](https://github.com/mozilla/glean.js/compare/v2.0.2...main)

* [#1770](https://github.com/mozilla/glean.js/pull/1770): Allow debugging in browser console via `window.Glean`.

# v2.0.2 (2023-09-14)

[Full changelog](https://github.com/mozilla/glean.js/compare/v2.0.1...v2.0.2)
Expand Down
17 changes: 17 additions & 0 deletions glean/src/core/glean/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,4 +434,21 @@ namespace Glean {
}
}

// Declare global variables for debugging in the browser.
declare global {
interface Window {
Glean: {
setLogPings: (flag: boolean) => void;
setDebugViewTag: (value: string) => void;
setSourceTags: (value: string[]) => void;
}
}
}

window.Glean = {
setLogPings: Glean.setLogPings,
setDebugViewTag: Glean.setDebugViewTag,
setSourceTags: Glean.setSourceTags
};

export default Glean;

0 comments on commit 6160f5e

Please sign in to comment.