File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,18 @@ const _module: NuxtModule<NuxtStoriesOptions> = defineNuxtModule<NuxtStoriesOpti
7777 // • alias → tells Vite where to find the package (resolves bare + subpath imports)
7878 // • build.transpile → prevents Vite AND Nitro from externalising them; Nuxt propagates
7979 // transpile entries to nitro.externals.inline automatically
80+ // In frame mode, suppress the devtools overlay when running inside the shell's iframe.
81+ // Must be an inline <head> script — Nuxt plugins run too late and devtools initialises
82+ // before them, causing a cross-origin error when it tries to read window.parent.__NUXT_DEVTOOLS_DISABLE__.
83+ // When the frame URL is opened directly window.self === window.top so the flag is never set.
84+ if ( mode === 'frame' ) {
85+ nuxt . options . app . head . script ||= [ ]
86+ nuxt . options . app . head . script . unshift ( {
87+ innerHTML : `if(window.self!==window.top)window.__NUXT_DEVTOOLS_DISABLE__=true` ,
88+ tagPosition : 'head' ,
89+ } )
90+ }
91+
8092 if ( mode !== 'frame' ) {
8193 // PrimeVue is registered via a client-only plugin to avoid any server-side
8294 // imports (which would break Nitro dev resolution via Node.js native ESM).
You can’t perform that action at this time.
0 commit comments