Javascript Binding - Finalize JavascriptBindingApiAllowOrigins: Per-browser isolation and origin normalization#5218
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
❌ Build CefSharp 136.1.40-CI5434 failed (commit c7297af541 by @) |
Fixes:
#5001
Summary:
This PR completes and optimizes the implementation of the
JavascriptBindingApiAllowOriginsfeature. The primary focus is shifting binding settings from a global state to a per-browser scope for better isolation and introducing robust origin normalization to ensure consistent security validation across different URL formats.Changes:
JavascriptBindingApiEnabled,JavascriptBindingApiAllowOrigins, etc.) from the globalCefAppUnmanagedWrappertoCefBrowserWrapper. This allows each browser instance to have its own independent list of allowed origins.JavascriptBindingSettings.csto automatically trim trailing slashes from strings added to theJavascriptBindingApiAllowOriginslist, preventing common configuration errors.CefAppUnmanagedWrapper::IsJavascriptBindingApiAllowed._wcsicmp) to align with standard origin matching behavior.How Has This Been Tested?
CefSharp.Test/JavascriptBinding/JavascriptBindingTests.csJavascriptBindingApiAllowOriginscorrectly blocks or allows the cefSharp object based on the frame's URL.CefBrowserWrapper).Screenshots (if appropriate): N/A
Types of changes
Checklist: