mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Throw if window.open is called on a window that has no chrome. Bug 306804, r+sr=jst
This commit is contained in:
parent
2555a451fd
commit
c96c0a25cd
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user