From f05143bc90e59aba0355e3217a9276ff9d3cec47 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 11 Jan 2024 17:28:44 +0100 Subject: [PATCH] fix: remove debugging code --- .../src/runtime/plugins/view/client.ts | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/packages/devtools/src/runtime/plugins/view/client.ts b/packages/devtools/src/runtime/plugins/view/client.ts index 40b0fdd46..c3139a85a 100644 --- a/packages/devtools/src/runtime/plugins/view/client.ts +++ b/packages/devtools/src/runtime/plugins/view/client.ts @@ -126,29 +126,23 @@ export async function setupDevToolsClient({ const runtimeConfig = useRuntimeConfig() const CLIENT_PATH = `${runtimeConfig.app.baseURL}/__nuxt_devtools__/client`.replace(/\/+/g, '/') const initialUrl = CLIENT_PATH + state.value.route - try { - iframe = document.createElement('iframe') + iframe = document.createElement('iframe') - // custom iframe props - Object.fromEntries(runtimeConfig.app.devtools?.iframeProps || {}) - for (const [key, value] of Object.entries(runtimeConfig.app.devtools?.iframeProps || {})) - iframe.setAttribute(key, String(value)) + // custom iframe props + for (const [key, value] of Object.entries(runtimeConfig.app.devtools?.iframeProps || {})) + iframe.setAttribute(key, String(value)) - iframe.id = 'nuxt-devtools-iframe' - iframe.src = initialUrl - iframe.onload = async () => { - try { - await waitForClientInjection() - client.syncClient() - } - catch (e) { - console.error('Nuxt DevTools client injection failed') - console.error(e) - } + iframe.id = 'nuxt-devtools-iframe' + iframe.src = initialUrl + iframe.onload = async () => { + try { + await waitForClientInjection() + client.syncClient() + } + catch (e) { + console.error('Nuxt DevTools client injection failed') + console.error(e) } - } - catch (e) { - console.error(e) } }