ElectronTokenBackendContribution may add a whitelist config that does not need to carry tokens. #8176
-
I try to write a BackendApplicationContribution to use express.static to host my static resources,when I use the Electron WebView tag to load the page of my resources, the html file of the entrance is accessed normally, and the inline JS and CSS files cannot be accessed and show a 403 error. I tried to inject cookies into the Electron WebView tag and tried to intercept resource requests to add headers, but none of them worked. I tried the following code, because the execution timing problem does not take effect:
So I think it is necessary to provide the configuration of ElectronTokenBackendContribution to allow certain requests not to be verified, but to be verified by the extension itself. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
cc @marechal-p |
Beta Was this translation helpful? Give feedback.
-
@zhaomenghuan I would recommend rebinding the |
Beta Was this translation helpful? Give feedback.
-
I should look into why the tokens aren't set in the webviews though. @zhaomenghuan can you share the bit of code that instantiates and mounts the webview? |
Beta Was this translation helpful? Give feedback.
@zhaomenghuan I would recommend rebinding the
ElectronTokenValidator
class to override theallowRequest(req)
function to add your custom logic for now.