Summary
org.cef.browser.CefBrowser has no way for a Java caller to grant or deny a getUserMedia()/geolocation/notification permission request. CEF's CefClient::GetPermissionHandler() (include/cef_permission_handler.h) is the only hook for this -- with no handler registered, Alloy style (JCEF's default) silently denies every media/permission request, and there's no way to override that from Java at all.
grep-confirmed before this fix: no permission_handler.cpp/CefPermissionHandler anywhere in native/ or java/org/cef/handler/.
Fix
Implemented in commit 17ba666 on branch coverage/phase1-value-objects-phase2-handlers:
native/permission_handler.{h,cpp} + org.cef.handler.CefPermissionHandler (+ CefPermissionHandlerAdapter), wired into client_handler.cpp/CefClient the same way every other handler type is.
org.cef.callback.CefMediaAccessCallback / CefPermissionPromptCallback (+ _N native implementations), following the CefJSDialogCallback_N pattern.
- Permission-type/result bit flags exposed as raw
int constants (CefPermissionHandler.MediaAccessPermissionType, CefPermissionHandler.PermissionRequestResult), matching cef_media_access_permission_types_t/cef_permission_request_result_t's declaration order exactly -- same convention as CefContextMenuParams.TypeFlags.
Not yet covered by an automated test
getUserMedia() requires a secure context (HTTPS or localhost); the JUnit test harness's loadPage() serves everything over http://test.com, so a getUserMedia() call from test content would be rejected by Blink before ever reaching CEF's permission layer. A real test would need either a data:/file:/localhost origin or an https test server. Left as a follow-up if a coverage gap on permission_handler.cpp shows up later.
🤖 Generated with Claude Code
Summary
org.cef.browser.CefBrowserhas no way for a Java caller to grant or deny agetUserMedia()/geolocation/notification permission request. CEF'sCefClient::GetPermissionHandler()(include/cef_permission_handler.h) is the only hook for this -- with no handler registered, Alloy style (JCEF's default) silently denies every media/permission request, and there's no way to override that from Java at all.grep-confirmed before this fix: nopermission_handler.cpp/CefPermissionHandleranywhere innative/orjava/org/cef/handler/.Fix
Implemented in commit 17ba666 on branch
coverage/phase1-value-objects-phase2-handlers:native/permission_handler.{h,cpp}+org.cef.handler.CefPermissionHandler(+CefPermissionHandlerAdapter), wired intoclient_handler.cpp/CefClientthe same way every other handler type is.org.cef.callback.CefMediaAccessCallback/CefPermissionPromptCallback(+_Nnative implementations), following theCefJSDialogCallback_Npattern.intconstants (CefPermissionHandler.MediaAccessPermissionType,CefPermissionHandler.PermissionRequestResult), matchingcef_media_access_permission_types_t/cef_permission_request_result_t's declaration order exactly -- same convention asCefContextMenuParams.TypeFlags.Not yet covered by an automated test
getUserMedia()requires a secure context (HTTPS or localhost); the JUnit test harness'sloadPage()serves everything overhttp://test.com, so agetUserMedia()call from test content would be rejected by Blink before ever reaching CEF's permission layer. A real test would need either adata:/file:/localhostorigin or an https test server. Left as a follow-up if a coverage gap onpermission_handler.cppshows up later.🤖 Generated with Claude Code