devtools-next icon indicating copy to clipboard operation
devtools-next copied to clipboard

Vite integration iframe content fetch connection refused with Cross Origin Embedder Policy applied

Open abiari opened this issue 1 year ago • 1 comments

I have Cross Origin Embedder/Opener policies headers set to enable sharedArrayBuffer access. If i remove the Cross Origin headers, the devtools works as expected.

code

Dev tools attempt to fetch the entry html file fails.

Screenshot from 2024-08-07 16-25-08

Screenshot from 2024-08-07 16-24-11

abiari avatar Aug 07 '24 15:08 abiari

When you set this header, the devtools floating panel(embedded in the page as an iframe) will be refused to load by the browser. If you need that, you can use localhost:3000/__devtools__/ separate window.

alexzhang1030 avatar Aug 12 '24 01:08 alexzhang1030

@abiari I made a PR (#710) to fix this.

When you set this header, the devtools floating panel(embedded in the page as an iframe) will be refused to load by the browser.

@alexzhang1030 The blockage can be avoided by applying the same headers to the devtools page response as those on the application page, which can be configured using server.headers in the Vite config.

nighca avatar Nov 22 '24 03:11 nighca

@nighca Thank you lots for this, I will spin this up asap to test and feedback.

abiari avatar Mar 10 '25 20:03 abiari