diff --git a/toolkit/components/browser/nsWebBrowser.cpp b/toolkit/components/browser/nsWebBrowser.cpp index 2fdaf1f3a233..47aa7096ee2f 100644 --- a/toolkit/components/browser/nsWebBrowser.cpp +++ b/toolkit/components/browser/nsWebBrowser.cpp @@ -102,7 +102,8 @@ nsIWidget* nsWebBrowser::EnsureWidget() { already_AddRefed nsWebBrowser::Create( nsIWebBrowserChrome* aContainerWindow, nsIWidget* aParentWidget, const OriginAttributes& aOriginAttributes, - dom::BrowsingContext* aBrowsingContext) { + dom::BrowsingContext* aBrowsingContext, + bool aDisableHistory /* = false */) { RefPtr browser = new nsWebBrowser( aBrowsingContext->IsContent() ? typeContentWrapper : typeChromeWrapper); @@ -152,7 +153,7 @@ already_AddRefed nsWebBrowser::Create( docShell->InitSessionHistory(); - if (XRE_IsParentProcess()) { + if (XRE_IsParentProcess() && !aDisableHistory) { // Hook up global history. Do not fail if we can't - just warn. DebugOnly rv = browser->EnableGlobalHistory(browser->mShouldEnableHistory); diff --git a/toolkit/components/browser/nsWebBrowser.h b/toolkit/components/browser/nsWebBrowser.h index da4c18c77b07..0867c0def89f 100644 --- a/toolkit/components/browser/nsWebBrowser.h +++ b/toolkit/components/browser/nsWebBrowser.h @@ -108,7 +108,8 @@ class nsWebBrowser final : public nsIWebBrowser, static already_AddRefed Create( nsIWebBrowserChrome* aContainerWindow, nsIWidget* aParentWidget, const mozilla::OriginAttributes& aOriginAttributes, - mozilla::dom::BrowsingContext* aBrowsingContext); + mozilla::dom::BrowsingContext* aBrowsingContext, + bool aDisableHistory = false); protected: virtual ~nsWebBrowser(); diff --git a/xpfe/appshell/nsAppShellService.cpp b/xpfe/appshell/nsAppShellService.cpp index ecc23b23f2e1..17d1e35b689f 100644 --- a/xpfe/appshell/nsAppShellService.cpp +++ b/xpfe/appshell/nsAppShellService.cpp @@ -495,7 +495,8 @@ nsAppShellService::CreateWindowlessBrowser(bool aIsChrome, * an associated doc shell, which is what we're interested in. */ nsCOMPtr browser = - nsWebBrowser::Create(stub, widget, OriginAttributes(), browsingContext); + nsWebBrowser::Create(stub, widget, OriginAttributes(), browsingContext, + true /* disable history */); if (NS_WARN_IF(!browser)) { NS_ERROR("Couldn't create instance of nsWebBrowser!");