Bug 172077 Need a way for embedders to disable all plugins
patch by locka, chpe@gnome.org r=bz sr=mscott git-svn-id: svn://10.0.0.236/trunk@158843 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user