Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix opening two signin windows from WebChannel connection #982

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions devtools/server/actors/replay/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,20 @@ function initializeRecordingWebChannel() {
);
const localUrl = "http://localhost:8080/";

const replayio = /^https:\/\/.+.replay.io\/?$/;
const previewBranches = /^https:\/\/.+-recordreplay.vercel.app\/?$/;
// custom subdomains
registerWebChannel(/^https:\/\/.+.replay.io$/);
registerWebChannel(replayio);
// preview branches
registerWebChannel(/^https:\/\/.+-recordreplay.vercel.app$/);
registerWebChannel(pageUrl);
registerWebChannel(previewBranches);
if (!replayio.test(pageUrl) && !previewBranches.test(pageUrl)) {
console.log(pageUrl, replayio, previewBranches);
registerWebChannel(pageUrl);
}
registerWebChannel(localUrl);

function registerWebChannel(url) {
console.log("Registering WebChannel for", url);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing these console logs don't end up polluting the users pane because they run in a separate browser process?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. They only log to the browser console and not the web page's console.

const urlForWebChannel = url instanceof RegExp ? url : Services.io.newURI(url);
const channel = new WebChannel("record-replay-token", urlForWebChannel);

Expand Down
Loading