The patch is based on code inspection. SizeShell may run scripts https://searchfox.org/mozilla-central/rev/cecdac0aa5733fee515a166b6e31e38cc58abf32/xpfe/appshell/AppWindow.cpp#1180,1182 The patch is very conservative. It keeps returning success code in the cases where it would return such without the patch and only adds null check right before accessing mDocShell. mDebuting value stays false after the method call. Differential Revision: https://phabricator.services.mozilla.com/D115249