Skip to content

Instantly share code, notes, and snippets.

@jasonLaster
Created November 17, 2020 23:58
Show Gist options
  • Select an option

  • Save jasonLaster/0c0e1a980aff6054a659123ac3c27627 to your computer and use it in GitHub Desktop.

Select an option

Save jasonLaster/0c0e1a980aff6054a659123ac3c27627 to your computer and use it in GitHub Desktop.
diff --git a/devtools/server/actors/replay/connection.js b/devtools/server/actors/replay/connection.js
index d1ac13985178..f4ab5763d54c 100644
--- a/devtools/server/actors/replay/connection.js
+++ b/devtools/server/actors/replay/connection.js
@@ -10,7 +10,9 @@ const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);
const { OS } = ChromeUtils.import("resource://gre/modules/osfile.jsm");
-const { setTimeout } = Components.utils.import('resource://gre/modules/Timer.jsm');
+const { setTimeout } = Components.utils.import(
+ "resource://gre/modules/Timer.jsm"
+);
XPCOMUtils.defineLazyModuleGetters(this, {
AppUpdater: "resource:///modules/AppUpdater.jsm",
@@ -232,6 +234,7 @@ Services.ppmm.addMessageListener("RecordingFinished", {
authId: getLoggedInUserAuthId(),
recordingData: msg.data,
});
+ Services.cpmm.sendAsyncMessage("RecordingSaved", msg.data);
},
});
diff --git a/devtools/startup/DevToolsStartup.jsm b/devtools/startup/DevToolsStartup.jsm
index 8c65418d9dc9..337410097391 100644
--- a/devtools/startup/DevToolsStartup.jsm
+++ b/devtools/startup/DevToolsStartup.jsm
@@ -1738,7 +1738,9 @@ function reloadAndRecordTab(gBrowser) {
}
// Don't preprocess recordings if we will be submitting them for testing.
- if (Services.prefs.getBoolPref("devtools.recordreplay.submitTestRecordings")) {
+ if (
+ Services.prefs.getBoolPref("devtools.recordreplay.submitTestRecordings")
+ ) {
env.set("RECORD_REPLAY_DONT_PROCESS_RECORDINGS", "1");
}
@@ -1773,7 +1775,7 @@ function reloadAndRecordTab(gBrowser) {
let gFinishedRecordingWaiter;
-Services.ppmm.addMessageListener("RecordingFinished", {
+Services.ppmm.addMessageListener("RecordingSaved", {
async receiveMessage(msg) {
if (gFinishedRecordingWaiter) {
gFinishedRecordingWaiter(msg.data);
@@ -1821,7 +1823,9 @@ async function reloadAndStopRecordingTab(gBrowser) {
// When the submitTestRecordings pref is set we don't load the viewer,
// but show a simple page that the recording was submitted, to make things
// simpler for QA and provide feedback that the pref was set correctly.
- if (Services.prefs.getBoolPref("devtools.recordreplay.submitTestRecordings")) {
+ if (
+ Services.prefs.getBoolPref("devtools.recordreplay.submitTestRecordings")
+ ) {
const url = gBrowser.currentURI.spec;
fetch(`https://test-inbox.replay.io/${recordingId}:${url}`);
const why = `Test recording added: ${recordingId}`;
@@ -1919,6 +1923,9 @@ function viewRecordings() {
function isAuthenticationEnabled() {
// Authentication is controlled by a preference but can be disabled by an
// environment variable.
- return Services.prefs.getBoolPref("devtools.recordreplay.authentication-enabled")
- && !env.get("RECORD_REPLAY_DISABLE_AUTHENTICATION");
+ return (
+ Services.prefs.getBoolPref(
+ "devtools.recordreplay.authentication-enabled"
+ ) && !env.get("RECORD_REPLAY_DISABLE_AUTHENTICATION")
+ );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment