Skip to content

Commit

Permalink
Bug 172077 Need a way for embedders to disable all plugins
Browse files Browse the repository at this point in the history
patch by locka, chpe@gnome.org r=bz sr=mscott
  • Loading branch information
timeless%mozdev.org committed Jul 7, 2004
1 parent ec33ae5 commit 652553c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docshell/base/nsDocShell.cpp
Expand Up @@ -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<nsIDocShell> 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<nsIURIContentListener>
parentURIListener(do_GetInterface(aParent));
if (parentURIListener)
Expand Down

0 comments on commit 652553c

Please sign in to comment.