diff --git a/libs/plugin-types/index.d.ts b/libs/plugin-types/index.d.ts index 7fd89f4..f85e85d 100644 --- a/libs/plugin-types/index.d.ts +++ b/libs/plugin-types/index.d.ts @@ -1231,13 +1231,14 @@ export interface Context { /** * Changes the current open page to given page. Requires `content:read` permission. * @param page the page to open + * @param newWindow if true opens the page in a new window * * @example * ```js * context.openPage(page); * ``` */ - openPage(page: Page): void; + openPage(page: Page, newWindow?: boolean): void; /** * Aligning will move all the selected layers to a position relative to one diff --git a/libs/plugins-runtime/src/lib/api/index.ts b/libs/plugins-runtime/src/lib/api/index.ts index fa4122d..7ee4945 100644 --- a/libs/plugins-runtime/src/lib/api/index.ts +++ b/libs/plugins-runtime/src/lib/api/index.ts @@ -317,9 +317,9 @@ export function createApi( return plugin.context.createPage(); }, - openPage(page: Page): void { + openPage(page: Page, newWindow?: boolean): void { checkPermission('content:read'); - plugin.context.openPage(page); + plugin.context.openPage(page, newWindow ?? true); }, alignHorizontal(