Created
September 3, 2020 17:16
-
-
Save jasonLaster/1bd068ab5e4dd6016e0f444830c76635 to your computer and use it in GitHub Desktop.
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
| diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js | |
| index 2c1a547dce87..9e0f0b38a36c 100644 | |
| --- a/browser/app/profile/firefox.js | |
| +++ b/browser/app/profile/firefox.js | |
| @@ -221,7 +221,7 @@ pref("browser.defaultbrowser.notificationbar", false); | |
| // 0 = blank, 1 = home (browser.startup.homepage), 2 = last visited page, 3 = resume previous browser session | |
| // The behavior of option 3 is detailed at: http://wiki.mozilla.org/Session_Restore | |
| pref("browser.startup.page", 1); | |
| -pref("browser.startup.homepage", "http://google.com"); | |
| +pref("browser.startup.homepage", "http://localhost:3000"); | |
| pref("browser.startup.homepage.abouthome_cache.enabled", false); | |
| // Whether we should skip the homepage when opening the first-run page | |
| diff --git a/devtools/startup/DevToolsStartup.jsm b/devtools/startup/DevToolsStartup.jsm | |
| index 01fceea4165e..def2cc6598df 100644 | |
| --- a/devtools/startup/DevToolsStartup.jsm | |
| +++ b/devtools/startup/DevToolsStartup.jsm | |
| @@ -620,6 +620,7 @@ DevToolsStartup.prototype = { | |
| return; | |
| } | |
| this.recordingButtonCreated = true; | |
| + this.initializeRecordingWebChannel(); | |
| createRecordingButton(); | |
| }, | |
| @@ -698,6 +699,44 @@ DevToolsStartup.prototype = { | |
| } | |
| }, | |
| + initializeRecordingWebChannel() { | |
| + let channel; | |
| + console.log(`>> initializeRecordingWebChannel`); | |
| + | |
| + // Register a channel for the URL in preferences. Also update the WebChannel if | |
| + // the URL changes. | |
| + // Services.prefs.addObserver( | |
| + // "devtools.recordreplay.recordingsUrl", | |
| + // registerWebChannel | |
| + // ); | |
| + registerWebChannel(); | |
| + | |
| + function registerWebChannel() { | |
| + console.log( | |
| + `>>> cloud server`, | |
| + Services.prefs.getStringPref("devtools.recordreplay.cloudServer") | |
| + ); | |
| + const pageUrl = Services.prefs.getStringPref( | |
| + "devtools.recordreplay.recordingsUrl" | |
| + ); | |
| + | |
| + console.log(`>> register recording`, pageUrl); | |
| + | |
| + if (channel) { | |
| + channel.stopListening(); | |
| + } | |
| + | |
| + const urlForWebChannel = Services.io.newURI(pageUrl); | |
| + channel = new WebChannel("record-replay", urlForWebChannel); | |
| + console.log(`>> new channel`, pageUrl); | |
| + | |
| + channel.listen((id, message, target) => { | |
| + // Defer loading the ProfilerPopupBackground script until it's absolutely needed, | |
| + // as this code path gets loaded at startup. | |
| + console.log(`>>>> blowza`, { id, message }); | |
| + }); | |
| + } | |
| + }, | |
| /* | |
| * We listen to the "Web Developer" system menu, which is under "Tools" main item. | |
| * This menu item is hardcoded empty in Firefox UI. We listen for its opening to | |
| diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js | |
| index 62fbce38f258..1cd6e85b14b4 100644 | |
| --- a/modules/libpref/init/all.js | |
| +++ b/modules/libpref/init/all.js | |
| @@ -840,6 +840,8 @@ pref("toolkit.dump.emit", false); | |
| // Address of the cloud server to connect to for record/replay sessions. | |
| pref("devtools.recordreplay.cloudServer", "wss://dispatch.replay.io"); | |
| +pref("devtools.recordreplay.recordingsUrl", "http://localhost:3000") | |
| +pref("devtools.recordreplay.user", "") | |
| // Whether to upload source maps and original sources to the cloud server. | |
| pref("devtools.recordreplay.uploadSourceMaps", true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment