From 652553c5cc14cd234ffc15f0ad82698607b5f8d3 Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Wed, 7 Jul 2004 07:15:35 +0000 Subject: [PATCH] Bug 172077 Need a way for embedders to disable all plugins patch by locka, chpe@gnome.org r=bz sr=mscott --- docshell/base/nsDocShell.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index d3404ce11d4c6..1b2201fc0f0d9 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -1757,6 +1757,34 @@ nsDocShell::SetParent(nsIDocShellTreeItem * aParent) */ mParent = aParent; + // If parent is another docshell, we inherit all their flags for + // allowing plugins, scripting etc. + nsCOMPtr parentAsDocShell = do_QueryInterface(mParent); + if (parentAsDocShell) + { + PRBool value; + if (NS_SUCCEEDED(parentAsDocShell->GetAllowPlugins(&value))) + { + SetAllowPlugins(value); + } + if (NS_SUCCEEDED(parentAsDocShell->GetAllowJavascript(&value))) + { + SetAllowJavascript(value); + } + if (NS_SUCCEEDED(parentAsDocShell->GetAllowMetaRedirects(&value))) + { + SetAllowMetaRedirects(value); + } + if (NS_SUCCEEDED(parentAsDocShell->GetAllowSubframes(&value))) + { + SetAllowSubframes(value); + } + if (NS_SUCCEEDED(parentAsDocShell->GetAllowImages(&value))) + { + SetAllowImages(value); + } + } + nsCOMPtr parentURIListener(do_GetInterface(aParent)); if (parentURIListener)