[minor fix] If the master password is set, sometimes throws an error

This commit is contained in:
janekptacijarabaci
2017-04-22 13:53:42 +02:00
committed by roytam1
parent 961a0ee9ee
commit 19bc82d752
+5 -4
View File
@@ -262,12 +262,13 @@
<handler event="popupshowing"><![CDATA[
// Capture the previous focus before has a chance to get set inside the panel
try {
this._prevFocus = document.commandDispatcher.focusedElement;
if (this._prevFocus)
this._prevFocus = Components.utils
.getWeakReference(document.commandDispatcher.focusedElement);
if (this._prevFocus.get())
return;
} catch (ex) { }
this._prevFocus = document.activeElement;
this._prevFocus = Components.utils.getWeakReference(document.activeElement);
]]></handler>
<handler event="popupshown"><![CDATA[
// Fire event for accessibility APIs
@@ -284,7 +285,7 @@
]]></handler>
<handler event="popuphidden"><![CDATA[
var currentFocus = this._currentFocus;
var prevFocus = this._prevFocus;
var prevFocus = this._prevFocus ? this._prevFocus.get() : null;
this._currentFocus = null;
this._prevFocus = null;
if (prevFocus && currentFocus && this.getAttribute("norestorefocus") != "true") {