Skip to content

Instantly share code, notes, and snippets.

@mostlygeek
Created September 6, 2018 23:38
Show Gist options
  • Save mostlygeek/163b9da7f8589ae4628fd5901ce45446 to your computer and use it in GitHub Desktop.
Save mostlygeek/163b9da7f8589ae4628fd5901ce45446 to your computer and use it in GitHub Desktop.
Manually triggering normandy's show-heartbeat action w/ the Fx browser console
// copy + paste these commands into the browser console to trigger
// the heartbeat pop up
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://normandy/lib/Heartbeat.jsm");
ChromeUtils.import("resource://normandy/lib/SandboxManager.jsm");
const recentWindow = Services.wm.getMostRecentNonPBWindow("navigator:browser");
const sm = new SandboxManager();
new Heartbeat(recentWindow, sm, {flowId: "test",
message: "hello",
thanksMessage:"ty",
learnMoreMessage:"learn more",
learnMoreUrl:"https://www.mozilla.org",
engagementButtonLabel: "BUTTON!"})
// options reference:
// https://searchfox.org/mozilla-central/rev/6201a9e0067cf6af118c6a99ae9314b8ceb2c4d5/toolkit/components/normandy/lib/Heartbeat.jsm#46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment