Throw if window.open is called on a window that has no chrome. Bug 306804, r+sr=jst

This commit is contained in:
bzbarsky%mit.edu 2005-09-10 04:16:59 +00:00
Родитель 2873f74e31
Коммит 98f698b036
3 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -5565,6 +5565,14 @@ nsGlobalWindow::OpenInternal(const nsAString& aUrl, const nsAString& aName,
aExtraArgument, aReturn),
NS_ERROR_NOT_INITIALIZED);
nsCOMPtr<nsIWebBrowserChrome> chrome;
GetWebBrowserChrome(getter_AddRefs(chrome));
if (!chrome) {
// No chrome means we don't want to go through with this open call
// -- see nsIWindowWatcher.idl
return NS_ERROR_NOT_AVAILABLE;
}
nsXPIDLCString url;
nsresult rv = NS_OK;

Просмотреть файл

@ -75,7 +75,9 @@ interface nsIWindowWatcher : nsISupports {
/** Create a new window. It will automatically be added to our list
(via addWindow()).
@param aParent parent window. null if not.
@param aParent parent window, if any. Null if no parent. If it is
impossible to get to an nsIWebBrowserChrome from aParent, this
method will effectively act as if aParent were null.
@param aURL url to which to open the new window. Must already be
escaped, if applicable. can be null.
@param aName window name from JS window.open. can be null.

Просмотреть файл

@ -74,7 +74,9 @@ interface nsPIWindowWatcher : nsISupports
/** Like the public interface's open(), but can deal with openDialog
style arguments.
@param aParent parent window, if any. null if not.
@param aParent parent window, if any. Null if no parent. If it is
impossible to get to an nsIWebBrowserChrome from aParent, this
method will effectively act as if aParent were null.
@param aURL url to which to open the new window. Must already be
escaped, if applicable. can be null.
@param aName window name from JS window.open. can be null.