GoogleChromeLabs / GoogleChromeLabs/comlink

How to releaseProxy from the `expose()` side?

Open
#674 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
12.8k
Forks
435
PR merge metrics
No merged PRs in 30d

Description

I am exposing JS object to iframe from the main thread.
When I navigate between pages, the object gets exposed to iframe window multiple times, and got repeated requests.
If I enter the page with iframe 3 times, a request from iframe will trigger 3 times.

After some experiment I found that if I releaseProxy from within iframe, the problem is gone.
But I don't have full control over the content in iframe, thus need to find a way to release proxy from the `expose()` side (main thread)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.