vscode-docs icon indicating copy to clipboard operation
vscode-docs copied to clipboard

CORP header missing in instructions how to test web extensions

Open VitGottwald opened this issue 1 year ago • 4 comments

Test your web extension in vscode.dev needs one extra step to properly serve web extensions from localhost. The Cross-Origin-Resource-Policy: cross-origin header is required. This can be added by creating a serve.json:

cat > serve.json << EOF
{
  "headers": [
    {
      "source": "**/*",
      "headers": [
        {
          "key": "Cross-Origin-Resource-Policy",
          "value": "cross-origin"
        }
      ]
    }
  ]
}
EOF

Without the CORP header the extension icon and other resources do not load.

For example our HLASM extension which runs in web workers and requires SharedArrayBuffer to function does not start at all without this extra header.

Image

VitGottwald avatar Dec 09 '24 07:12 VitGottwald

@joyceerhl Can you take a look at this?

ntrogh avatar Dec 12 '24 20:12 ntrogh

Bonsoir mon frère svp je veut m'exercer avec ce code

zakari96 avatar Dec 26 '24 16:12 zakari96

I also opened an issue with serve with a suggested fix on their side https://github.com/vercel/serve/issues/817 .

VitGottwald avatar Jan 06 '25 11:01 VitGottwald

@joaomoreno Can you take a look at this proposed fix?

ntrogh avatar Jan 06 '25 12:01 ntrogh