зеркало из https://github.com/mozilla/gecko-dev.git
Check for null focusedWindow in case of full-page plugins b=304243 r=IanN sr=jag
This commit is contained in:
Родитель
2433929f4a
Коммит
8decabdc7b
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче