Repository navigation
fix: main process crashes from WebUI host matching, worker AI bindings, extension background page media and serial port revocation - #53305
Conversation
…s, extension background page media and serial port revocation - Only treat chrome://accessibility and devtools://devtools (or chrome://) as WebUI URLs; matching on host alone made an ordinary navigation to http://accessibility/ create WebUI bindings for a non-WebUI process. - Don't route LanguageModel requests that have no live document (workers) to the local AI handler; report them as unavailable instead of dereferencing a null frame. - Create the WebContentsPermissionHelper for every WebContents that api::WebContents becomes the delegate of, including extension background pages, so media/pointer-lock permission checks have a helper to use. - Return early from SerialChooserContext::RevokePortPermissionWebInitiated when the port is no longer known instead of dereferencing end().
|
Release Notes Persisted
|
|
I was unable to backport this PR to "43-x-y" cleanly; |
|
I was unable to backport this PR to "44-x-y" cleanly; |
|
I have automatically backported this PR to "45-x-y", please check out #53325 |
|
@MarshallOfSound has manually backported this PR to "43-x-y", please check out #53332 |
|
@MarshallOfSound has manually backported this PR to "44-x-y", please check out #53333 |
…s, extension background page media and serial port revocation (#53332) fix: main process crashes from WebUI host matching, worker AI bindings, extension background page media and serial port revocation (#53305) - Only treat chrome://accessibility and devtools://devtools (or chrome://) as WebUI URLs; matching on host alone made an ordinary navigation to http://accessibility/ create WebUI bindings for a non-WebUI process. - Don't route LanguageModel requests that have no live document (workers) to the local AI handler; report them as unavailable instead of dereferencing a null frame. - Create the WebContentsPermissionHelper for every WebContents that api::WebContents becomes the delegate of, including extension background pages, so media/pointer-lock permission checks have a helper to use. - Return early from SerialChooserContext::RevokePortPermissionWebInitiated when the port is no longer known instead of dereferencing end(). (cherry picked from commit 0cfc258)
…s, extension background page media and serial port revocation (#53333) fix: main process crashes from WebUI host matching, worker AI bindings, extension background page media and serial port revocation (#53305) - Only treat chrome://accessibility and devtools://devtools (or chrome://) as WebUI URLs; matching on host alone made an ordinary navigation to http://accessibility/ create WebUI bindings for a non-WebUI process. - Don't route LanguageModel requests that have no live document (workers) to the local AI handler; report them as unavailable instead of dereferencing a null frame. - Create the WebContentsPermissionHelper for every WebContents that api::WebContents becomes the delegate of, including extension background pages, so media/pointer-lock permission checks have a helper to use. - Return early from SerialChooserContext::RevokePortPermissionWebInitiated when the port is no longer known instead of dereferencing end(). (cherry picked from commit 0cfc258)
Description of Change
Four small main-process crash fixes, each with a crash-case fixture (except the serial one, which needs hardware to exercise):
ElectronWebUIControllerFactorymatched WebUI pages by host only, so navigating a window to e.g.http://accessibility/was treated as a WebUI navigation and hitNOTREACHEDinRenderFrameHostImpl::AllowBindings. It now also requireschrome://(ordevtools://for the DevTools host).session.registerLocalAIHandler()set, aLanguageModelcall from a Worker reachedProxyingAIManagerwith noRenderFrameHostand dereferenced it. Such requests are now reported as unavailable.api::WebContentsas their delegate but never had aWebContentsPermissionHelper, sonavigator.mediaDevices.*(and pointer/keyboard lock) from a background page dereferenced null. The helper is now created for every WebContents thatapi::WebContentsadopts.SerialChooserContext::RevokePortPermissionWebInitiateddereferencedport_info_.end()whenSerialPort.forget()was called for a port the context no longer knew about (e.g. after the device was unplugged).Checklist
npm testpassesRelease Notes
Notes: Fixed main process crashes when navigating to
http://accessibility/orhttp://devtools/, when using theLanguageModelAPI from a Worker with a local AI handler registered, when an extension background page usednavigator.mediaDevices, and when callingSerialPort.forget()for a disconnected device.