* Move LegacyBindingEnabled / JavascriptBindingPropertyName to per browser settings
* Stricter test
---------
Co-authored-by: Alex Maitland <amaitland@users.noreply.github.com>
* Javascript Binding - Add Ability to limit origins
* Move JS binding settings to CefBrowserWrapper and optimize origin validation
* Initialize origins to null
* Normalize allowed origins
* Optimize origin validation
* Add null check for origin compare
* Fix JavaScript Binding API settings for popups
Move the JS binding API configuration block out of the !browser->IsPopup() scope
in OnBrowserCreated. This ensures that IsJavascriptBindingApiAllowed() enforces
configured restrictions for popups as well.
* Fix possible null deref for JavascriptBindingApiAllowOrigins
In IsJavascriptBindingApiAllowed, added a null check for JavascriptBindingApiAllowOrigins
to prevent a potential null dereference if JavascriptBindingApiHasAllowOrigins is true
but the allowOrigins list itself was null.
* Simplify origin normalization and add null check
* Add more test cases
* Refactor IsJavascriptBindingApiAllowed signature
Refactored IsJavascriptBindingApiAllowed to accept a CefBrowserWrapper^ parameter directly, eliminating redundant lookups and improving clarity. Updated all call sites to pass the browser wrapper explicitly.
* Clarify summary for HasJavascriptBindingApiAllowOrigins
Clarify documentation for HasJavascriptBindingApiAllowOrigins method to specify zero or more origins
* Simplify origin comparison logic in CefAppUnmanagedWrapper
Refactored code to directly compare wide string origins using
_wcsicmp, removing unnecessary pointer casts and null checks.
This streamlines the logic and improves readability.
* Add tests for JavaScript binding API behavior across cross-origin navigation
---------
Co-authored-by: amaitland <307872+amaitland@users.noreply.github.com>
Co-authored-by: Luca Sonntag <luca.sonntag@cgm.com>
- JavascriptCallbackRegistry - Get BrowserId From V8Context
- Render Process - Rewrite to store root object wrapper by frame instead of per browser
- Don't store JavascriptRootObjectWrapper in the browserWrapper as CEF is calling destroyed more than it should.
- Revert "Tests - Simplify ShouldFailWhenIsObjectCachedCalledWithInvalidObjectName"
This reverts commit f8a81acf7a.
---------
Co-authored-by: amaitland <307872+amaitland@users.noreply.github.com>
- Start splitting tests out into own files where relevant
- Improve call ordering
- Use Assert.RaisesAsync where possible
- Classes have been renamed (Tests is now the standard suffix)
TODO: Some of the classes still need their method names changed