Created
September 6, 2018 23:38
-
-
Save mostlygeek/163b9da7f8589ae4628fd5901ce45446 to your computer and use it in GitHub Desktop.
Manually triggering normandy's show-heartbeat action w/ the Fx browser console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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