Add plugin API to open URL in external browser (#340)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Gregory Schier
2026-01-03 13:53:07 -08:00
committed by GitHub
parent 118b2faa76
commit 35a57bf7f5
8 changed files with 51 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@@ -53,6 +53,7 @@ export interface Context {
onClose?: () => void;
},
): Promise<{ close: () => void }>;
openExternalUrl(url: string): Promise<void>;
};
cookies: {
listNames(): Promise<ListCookieNamesResponse['names']>;

View File

@@ -646,6 +646,12 @@ export class PluginInstance {
},
};
},
openExternalUrl: async (url) => {
await this.#sendForReply(context, {
type: 'open_external_url_request',
url,
});
},
},
prompt: {
text: async (args) => {