You should think of the webview more as an html view (one that does not have any server or origin) rather than a webpage Posters on stackoverflow may have suggestions for workarounds https://github.com/microsoft/vscode/issues/72900#issuecomment-487140263