-
Notifications
You must be signed in to change notification settings - Fork 2
Tweaks #46
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
Conversation
return commands.listCommands(); | ||
} | ||
}; | ||
|
||
const endpoint = windowEndpoint(self.parent); | ||
expose(api, endpoint); | ||
|
||
app.started.then(() => { | ||
window.parent?.postMessage('extension-loaded', '*'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if createBridge
could expose a new ready: Promise<void>
, to make waiting for the extension in the IFrame to be ready more convenient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also there may be some race conditions depending on when the host defines the event listener and when the IFrame posts the message (too early / late).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is an open issue about that in Comlink: GoogleChromeLabs/comlink#665
So in our case we can likely implement a workaround by defining custom logic for exposing the ready
state of the IFrame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #47 against this PR to explore adding a ready
promise.
please update snapshots |
please update snapshots |
please update snapshots |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This updates the
listCommands
interface to return a promise and sends a message to the host indicating the extension has loaded.