Skip to content
This repository was archived by the owner on Jan 7, 2026. It is now read-only.

Commit da8288b

Browse files
mdbenitoAlotor
authored andcommitted
feat(plugins-runtime): allow openPage() to toggle opening on a new window or not
1 parent e48c5d4 commit da8288b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libs/plugin-types/index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,13 +1231,14 @@ export interface Context {
12311231
/**
12321232
* Changes the current open page to given page. Requires `content:read` permission.
12331233
* @param page the page to open
1234+
* @param newWindow if true opens the page in a new window
12341235
*
12351236
* @example
12361237
* ```js
12371238
* context.openPage(page);
12381239
* ```
12391240
*/
1240-
openPage(page: Page): void;
1241+
openPage(page: Page, newWindow?: boolean): void;
12411242

12421243
/**
12431244
* Aligning will move all the selected layers to a position relative to one

libs/plugins-runtime/src/lib/api/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,9 @@ export function createApi(
317317
return plugin.context.createPage();
318318
},
319319

320-
openPage(page: Page): void {
320+
openPage(page: Page, newWindow?: boolean): void {
321321
checkPermission('content:read');
322-
plugin.context.openPage(page);
322+
plugin.context.openPage(page, newWindow ?? true);
323323
},
324324

325325
alignHorizontal(

0 commit comments

Comments
 (0)