mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 10:17:59 +01:00
Some 'strictfocus' tweaks.
This commit is contained in:
@@ -578,8 +578,8 @@ const Buffer = Module("buffer", {
|
|||||||
let offsetX = 1;
|
let offsetX = 1;
|
||||||
let offsetY = 1;
|
let offsetY = 1;
|
||||||
|
|
||||||
if (elem instanceof HTMLFrameElement || elem instanceof HTMLIFrameElement) {
|
if (isinstance(elem [HTMLFrameElement, HTMLIFrameElement])) {
|
||||||
elem.contentWindow.focus();
|
buffer.focusElement(elem);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (elem instanceof HTMLAreaElement) { // for imagemap
|
else if (elem instanceof HTMLAreaElement) { // for imagemap
|
||||||
@@ -608,7 +608,7 @@ const Buffer = Module("buffer", {
|
|||||||
liberator.log("Invalid where argument for followLink()", 0);
|
liberator.log("Invalid where argument for followLink()", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
elem.focus();
|
buffer.focusElement(elem);
|
||||||
|
|
||||||
options.withContext(function () {
|
options.withContext(function () {
|
||||||
options.setPref("browser.tabs.loadInBackground", true);
|
options.setPref("browser.tabs.loadInBackground", true);
|
||||||
|
|||||||
@@ -735,13 +735,15 @@ const Events = Module("events", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// TODO: Merge with onFocusChange
|
||||||
onFocus: function (event) {
|
onFocus: function (event) {
|
||||||
function hasHTMLDocument(win) win && win.document && win.document instanceof HTMLDocument
|
function hasHTMLDocument(win) win && win.document && win.document instanceof HTMLDocument
|
||||||
|
|
||||||
let elem = event.originalTarget;
|
let elem = event.originalTarget;
|
||||||
let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem;
|
let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem;
|
||||||
|
|
||||||
if (hasHTMLDocument(win) && !buffer.focusAllowed(win))
|
if (hasHTMLDocument(win) && !buffer.focusAllowed(win)
|
||||||
|
&& isinstance(elem, [HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement]))
|
||||||
elem.blur();
|
elem.blur();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user