Skip to content

Commit

Permalink
Fix opening two signin windows from WebChannel connection (#982)
Browse files Browse the repository at this point in the history
* Fix opening two signin windows from WebChannel connection

* logs

* handle trailing slash
  • Loading branch information
ryanjduffy authored Mar 18, 2024
1 parent 33e7e0e commit 1348403
Showing 1 changed file with 9 additions and 3 deletions.
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);
const urlForWebChannel = url instanceof RegExp ? url : Services.io.newURI(url);
const channel = new WebChannel("record-replay-token", urlForWebChannel);

Expand Down

0 comments on commit 1348403

Please sign in to comment.