Skip to content

Commit

Permalink
default client app name
Browse files Browse the repository at this point in the history
  • Loading branch information
pacoccino committed Mar 23, 2024
1 parent 45dd2e7 commit c072962
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/core/src/ExtensionMessager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ export class ExtensionMessagerClient<T extends ExtensionMessageRequestData> {
onMessageHandler: ((message: ExtensionMessageResponse) => void) | undefined
port: chrome.runtime.Port | undefined

constructor({ name, port }: { name: string, port?: chrome.runtime.Port }) {
constructor({ name, port }: { name?: string, port?: chrome.runtime.Port }) {
this.handlers = {}
if (port) {
this.port = port
}
if (!name) {
name = (window || document)?.location?.origin || 'unknown'
}
this.listen(name)
}

Expand Down

0 comments on commit c072962

Please sign in to comment.