Skip to content

Denial codes ​

A refused call rejects in the page with an Error whose code is one of these, and in Go returns a *domain.ErrDenied with the same Code and a Reason. Codes are stable; match on them, not on the reason text.

When several grants almost match, the most specific refusal wins: path_denied, then path_out_of_scope, origin_mismatch, and window_mismatch.

CodeMeaning
no_grantNo grant covers this call
window_mismatchA grant has the permission, but not for this window
origin_mismatchA grant has the permission, but not for the window's current origin, or the claimed origin differs from the window's real one
permission_absentThe matching grant does not include this permission
path_deniedThe path matches a deny pattern, or is malformed (.., NUL, UNC, device, relative)
path_out_of_scopeThe path matches no allow pattern, a symlink leads outside the scope, or a typed input names a different path than the one authorized
command_missingNo such command is registered
window_closedThe calling window is closed
unsupported_platformThe navigation target is not supported on this platform

Anything that is not a denial (your handler returned an error, a typed input failed to decode) has the code error. A malformed message from the page's own frame gets bad_request. A message dropped at the bridge gets no reply at all; it shows up in the audit log as bridge.reject.

Apache-2.0 licensed.