Check for null focusedWindow in case of full-page plugins b=304243 r=IanN sr=jag
git-svn-id: svn://10.0.0.236/trunk@185572 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
4f11d323fe
commit
478d9fff2b
@ -279,7 +279,7 @@ function getContentAreaFrameCount()
|
||||
function contentAreaFrameFocus()
|
||||
{
|
||||
const focusedWindow = document.commandDispatcher.focusedWindow;
|
||||
if (focusedWindow.top == window.content) {
|
||||
if (focusedWindow && focusedWindow.top == window.content) {
|
||||
gFocusedURL = focusedWindow.location.href;
|
||||
gFocusedDocument = focusedWindow.document;
|
||||
}
|
||||
|
||||
@ -86,7 +86,13 @@ function toJavaConsole()
|
||||
|
||||
function toOpenWindow( aWindow )
|
||||
{
|
||||
aWindow.document.commandDispatcher.focusedWindow.focus();
|
||||
try {
|
||||
// Try to focus the previously focused window e.g. message compose body
|
||||
aWindow.document.commandDispatcher.focusedWindow.focus();
|
||||
} catch (e) {
|
||||
// e.g. full-page plugin or non-XUL document; just raise the top window
|
||||
aWindow.focus();
|
||||
}
|
||||
}
|
||||
|
||||
function toOpenWindowByType( inType, uri )
|
||||
|
||||
@ -556,7 +556,7 @@
|
||||
var focusedWindow = document.commandDispatcher.focusedWindow;
|
||||
var saveFocus = false;
|
||||
|
||||
if (focusedWindow.top == window.content) {
|
||||
if (focusedWindow && focusedWindow.top == window.content) {
|
||||
saveFocus = true;
|
||||
} else {
|
||||
var contentWindow = window;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user