Skip to content

Commit

Permalink
[broadcast] Fixes bug when cloning multiple times
Browse files Browse the repository at this point in the history
Before this commit, in Chrome, when cloning multiple times a graph, the
oldest clones start losing their WebGL contexts at some point. The
reason is that the contexts are actually shared along tabs/windows, as
long as they allow referencing each other (which kind of makes some
sense I guess?).

The fix is to add by default "noopener" to the window.open call.
  • Loading branch information
jacomyal committed Feb 4, 2025
1 parent 0e6f7be commit 6b34d94
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/broadcast/src/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,12 @@ export class GephiLiteDriver extends TypedEventEmitter<GephiLiteEvents> {
* Helper/lifecycle methods:
* *************************
*/
openGephiLite({ baseUrl = "/gephi-lite", target = "_blank" }: { baseUrl?: string; target?: string } = {}) {
return open(`${baseUrl}?broadcast=${this.name}`, target);
openGephiLite({
baseUrl = "/gephi-lite",
target = "_blank",
features = "noopener",
}: { baseUrl?: string; target?: string; features?: string } = {}) {
return open(`${baseUrl}?broadcast=${this.name}`, target, features);
}
destroy(): void {
this.channel.onmessage = null;
Expand Down

0 comments on commit 6b34d94

Please sign in to comment.