diff --git a/dom/html/HTMLObjectElement.cpp b/dom/html/HTMLObjectElement.cpp index 3150ba26be0f..3714c2839fef 100644 --- a/dom/html/HTMLObjectElement.cpp +++ b/dom/html/HTMLObjectElement.cpp @@ -161,7 +161,12 @@ HTMLObjectElement::OnFocusBlurPlugin(Element* aElement, bool aFocus) nsCOMPtr olc = do_QueryInterface(aElement); bool hasRunningPlugin = false; if (olc) { - olc->GetHasRunningPlugin(&hasRunningPlugin); + // nsIObjectLoadingContent::GetHasRunningPlugin() fails when + // nsContentUtils::IsCallerChrome() returns false (which it can do even + // when we're processing a trusted focus event). We work around this by + // calling nsObjectLoadingContent::HasRunningPlugin() directly. + hasRunningPlugin = + static_cast(olc.get())->HasRunningPlugin(); } if (!hasRunningPlugin) { aFocus = false;