Menu
Home
Blog
Add-ons
Forum
Wiki
Developers
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
dependencies
vendor
mozbrowser
base
content
test
browser_bug484315.js
Go to the documentation of this file.
1
function
test
() {
2
var contentWin =
window
.open(
"about:blank"
,
""
,
"width=100,height=100"
);
3
var enumerator =
Cc
[
"@mozilla.org/appshell/window-mediator;1"
]
4
.getService(
Ci
.nsIWindowMediator)
5
.getEnumerator(
"navigator:browser"
);
6
7
while
(enumerator.hasMoreElements()) {
8
let
win
= enumerator.getNext();
9
if
(win.content == contentWin) {
10
gPrefService
.setBoolPref(
"browser.tabs.closeWindowWithLastTab"
,
false
);
11
win.gBrowser.removeCurrentTab();
12
ok(win.closed,
"popup is closed"
);
13
14
// clean up
15
if
(!win.closed)
16
win.close();
17
if
(
gPrefService
.prefHasUserValue(
"browser.tabs.closeWindowWithLastTab"
))
18
gPrefService
.clearUserPref(
"browser.tabs.closeWindowWithLastTab"
);
19
20
return
;
21
}
22
}
23
24
throw
"couldn't find the content window"
;
25
}
Cc
const Cc
Definition:
sbCoverHelper.jsm:27
window
let window
Definition:
nsSessionStore.js:2340
test
function test()
Definition:
browser_bug484315.js:1
gPrefService
var gPrefService
Definition:
overlay.js:34
Ci
const Ci
Definition:
sbCoverHelper.jsm:28
win
var win
Definition:
browser_bookmarksProperties.js:75