Extension refusals read as success:true at the top level of the reply
nb-bridge 0.16.66 · extension 0.2.23 · ab 2.1.185 · Windows · Chrome 156
What happens: when the extension answers a verb with {ok:false, errorCode:...}, the bridge wraps it as a success. The reply's top level says status:"ok", success:true, and the refusal sits only inside the output string. A caller that reads the top level, which is what status and success are for, believes the verb worked.
Expected: a refusal reads as a failure at the top level, like the bridge's own refusals (profile_mismatch, file_missing) already do.
Seen on nbrowser_set_file_input (not_multiple, input_not_found), which is fixed for that verb alone in 0.16.66. The cause is general: onHostFrameInner passes frame.ok === true payloads to resolve_ok, and deliveryEnv always sets success:true, so any extension verb that returns ok:false inside a successful frame has the same problem.
Why I did not change it for every verb: bridges and internal callers read these replies too. pup's login import calls nbrowser_export_site_session and nbrowser_export_saved_logins, and the internal extQuery path drops any reply with success:false. Each needs checking before the envelope changes.
Suggested fix: in resolve_ok, when payload.ok === false && payload.errorCode, return {success:false, ...payload}, after checking those callers.
1 Reply
Log in to reply.