diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 226c54aba561..60d3151a1d25 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -388,18 +388,10 @@ NS_IMETHODIMP nsDocShell::GetInterface(const nsIID & aIID, void **aSink) return NS_NOINTERFACE; } else if (aIID.Equals(NS_GET_IID(nsIAuthPrompt))) { - // if auth is not allowed, bail out - if (!mAllowAuth) - return NS_NOINTERFACE; + return NS_SUCCEEDED( + GetAuthPrompt(PROMPT_NORMAL, (nsIAuthPrompt **) aSink)) ? + NS_OK : NS_NOINTERFACE; - nsCOMPtr authPrompter(do_GetInterface(mTreeOwner)); - if (authPrompter) { - *aSink = authPrompter; - NS_ADDREF((nsISupports *) * aSink); - return NS_OK; - } - else - return NS_NOINTERFACE; } else if (aIID.Equals(NS_GET_IID(nsIProgressEventSink)) || aIID.Equals(NS_GET_IID(nsIHttpEventSink)) @@ -1709,6 +1701,9 @@ nsDocShell::SetItemType(PRInt32 aItemType) mItemType = aItemType; + // disable auth prompting for anything but content + mAllowAuth = mItemType == typeContent; + return NS_OK; } @@ -7080,15 +7075,6 @@ nsDocShell::SetBaseUrlForWyciwyg(nsIContentViewer * aContentViewer) nsresult nsDocShell::GetAuthPrompt(PRUint32 aPromptReason, nsIAuthPrompt **aResult) { - // if this docshell is of type chrome and has a chrome URI, then do not - // give out an auth prompt. NOTE: it is possible to load a non-chrome - // URI into a chrome docshell, so this check is important. - if (mCurrentURI && mItemType == typeChrome) { - PRBool chrome; - if (NS_SUCCEEDED(mCurrentURI->SchemeIs("chrome", &chrome)) && chrome) - return NS_ERROR_NOT_AVAILABLE; - } - // a priority prompt request will override a false mAllowAuth setting PRBool priorityPrompt = (aPromptReason == PROMPT_PROXY); diff --git a/mail/base/content/mailWindow.js b/mail/base/content/mailWindow.js index 9c19f60d82e6..f5981d289eca 100644 --- a/mail/base/content/mailWindow.js +++ b/mail/base/content/mailWindow.js @@ -199,6 +199,7 @@ function InitMsgWindow() msgWindow.SetDOMWindow(window); mailSession.AddMsgWindow(msgWindow); document.getElementById("messagepane").docShell.allowAuth = false; + msgWindow.rootDocShell.allowAuth = true; } function AddDataSources() diff --git a/mail/extensions/newsblog/content/subscriptions.js b/mail/extensions/newsblog/content/subscriptions.js index 51a95c5ea7fe..b7b14ff1f8c4 100755 --- a/mail/extensions/newsblog/content/subscriptions.js +++ b/mail/extensions/newsblog/content/subscriptions.js @@ -36,15 +36,21 @@ var gRSSServer = null; -function doLoad() { - // extract the server argument - if (window.arguments[0].server) - gRSSServer = window.arguments[0].server; +function doLoad() +{ + // extract the server argument + if (window.arguments[0].server) + gRSSServer = window.arguments[0].server; - var ds = getSubscriptionsDS(gRSSServer); - var tree = document.getElementById('subscriptions'); - tree.database.AddDataSource(ds); - tree.builder.rebuild(); + var ds = getSubscriptionsDS(gRSSServer); + var tree = document.getElementById('subscriptions'); + tree.database.AddDataSource(ds); + tree.builder.rebuild(); + + var docshell = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) + .getInterface(Components.interfaces.nsIWebNavigation) + .QueryInterface(Components.interfaces.nsIDocShell); + docshell.allowAuth = true; } function onAccept() diff --git a/mailnews/base/resources/content/mailWindow.js b/mailnews/base/resources/content/mailWindow.js index 58203981f998..0b2fae9df4e3 100644 --- a/mailnews/base/resources/content/mailWindow.js +++ b/mailnews/base/resources/content/mailWindow.js @@ -222,6 +222,7 @@ function InitMsgWindow() var messagepane = document.getElementById("messagepane"); messagepane.docShell.allowAuth = false; + msgWindow.rootDocShell.allowAuth = true; } function messagePaneOnClick(event)