Skip to content

JCEF has no CefPermissionHandler binding (camera/mic/geolocation prompts unreachable from Java) #33

Description

@Thrameos

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

Activity

  1. added 2 commits that reference this issue on Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions