Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to solve the cross domain problem of js? #58

Closed
ajuner opened this issue Oct 9, 2022 · 4 comments
Closed

How to solve the cross domain problem of js? #58

ajuner opened this issue Oct 9, 2022 · 4 comments
Labels
question Further information is requested

Comments

@ajuner
Copy link

ajuner commented Oct 9, 2022

   Access to script at 'file:///D:/goproject/src/test-webview/app/assets/client.80aeb8cb.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome-untrusted, https, edge.
@ajuner
Copy link
Author

ajuner commented Oct 9, 2022

local html

@ajuner
Copy link
Author

ajuner commented Oct 11, 2022

I found a way to solve it, but I encountered a new problem. I want to pass the parameter to ”CreateCoreWebView2EnvironmentWithOptions“, but this seems incorrect
image

@gizmo-ds
Copy link
Contributor

You can try to use SetVirtualHostNameToFolderMapping, a simple example

@CarsonSlovoka
Copy link

I don't know how to add ICoreWebView2EnvironmentOptions for CreateCoreWebView2EnvironmentWithOptions, always get crush

ICoreWebView2EnvironmentOptionsVTbl

type ICoreWebView2EnvironmentOptions struct {
		queryInterface                            uintptr
		addRef                                    uintptr
		release                                   uintptr
		getAdditionalBrowserArguments             uintptr
		putAdditionalBrowserArguments             uintptr
		getLanguage                               uintptr
		putLanguage                               uintptr
		getTargetCompatibleBrowserVersion         uintptr
		putTargetCompatibleBrowserVersion         uintptr
		getAllowSingleSignOnUsingOSPrimaryAccount uintptr
		putAllowSingleSignOnUsingOSPrimaryAccount uintptr
	}

@jchv jchv added the question Further information is requested label Apr 25, 2023
@ajuner ajuner closed this as completed Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants