From 9b463573f8202c0c8dd9df38f192078db6b8169b Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 22 Jun 2023 00:27:13 +0200 Subject: [PATCH 1/8] feat: poc working --- .../devtools-kit/src/_types/client-api.ts | 13 ++++++++ .../client/components/DockingPanel.vue | 3 ++ .../src/runtime/plugins/devtools.client.ts | 4 ++- .../src/runtime/plugins/view/Frame.vue | 33 +++++++++++++++++++ .../src/runtime/plugins/view/FrameBox.vue | 14 ++------ packages/devtools/src/types/global.ts | 27 +++++++++++++++ packages/devtools/src/types/index.ts | 2 ++ 7 files changed, 83 insertions(+), 13 deletions(-) create mode 100644 packages/devtools/src/types/global.ts diff --git a/packages/devtools-kit/src/_types/client-api.ts b/packages/devtools-kit/src/_types/client-api.ts index d96db94b8b..fc82da2c81 100644 --- a/packages/devtools-kit/src/_types/client-api.ts +++ b/packages/devtools-kit/src/_types/client-api.ts @@ -55,8 +55,21 @@ export interface NuxtDevtoolsHostClient { reloadPage(): void closeDevTools(): void + /** + * Popup the DevTools frame into Picture-in-Picture mode + * + * Requires Chrome 111 with experimental flag enabled. + * + * Function is undefined when not supported. + * + * @see https://developer.chrome.com/docs/web-platform/document-picture-in-picture/ + */ + popup?(): any + /** * Update client, send to iframe if provided + * + * @internal */ updateClient(iframe?: HTMLIFrameElement): NuxtDevtoolsHostClient } diff --git a/packages/devtools/client/components/DockingPanel.vue b/packages/devtools/client/components/DockingPanel.vue index d665c83b4e..4c4b7bc47e 100644 --- a/packages/devtools/client/components/DockingPanel.vue +++ b/packages/devtools/client/components/DockingPanel.vue @@ -15,6 +15,9 @@ function refreshPage() {