mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Merge pull request #1136 from antonva/fix-1031
Add element property check to fix google product search bars.
This commit is contained in:
commit
de9fc2d4b5
1 changed files with 12 additions and 4 deletions
|
@ -2,7 +2,11 @@ import * as config from "@src/lib/config"
|
||||||
import { flatten } from "@src/lib/itertools"
|
import { flatten } from "@src/lib/itertools"
|
||||||
import state from "@src/state"
|
import state from "@src/state"
|
||||||
import * as Logging from "@src/lib/logging"
|
import * as Logging from "@src/lib/logging"
|
||||||
import { activeTabId, openInNewTab, activeTabContainerId } from "@src/lib/webext"
|
import {
|
||||||
|
activeTabId,
|
||||||
|
openInNewTab,
|
||||||
|
activeTabContainerId,
|
||||||
|
} from "@src/lib/webext"
|
||||||
const logger = new Logging.Logger("dom")
|
const logger = new Logging.Logger("dom")
|
||||||
|
|
||||||
// From saka-key lib/dom.js, under Apachev2
|
// From saka-key lib/dom.js, under Apachev2
|
||||||
|
@ -44,12 +48,16 @@ export function isTextEditable(element: Element) {
|
||||||
|
|
||||||
// ARIA stuff isn't pulled out into fields, so we have to
|
// ARIA stuff isn't pulled out into fields, so we have to
|
||||||
// manually inspect the attributes to find it.
|
// manually inspect the attributes to find it.
|
||||||
|
// Google products perform some witchcraft with it's search input as
|
||||||
|
// seen in #1031, the conditional seems to be enough to fix it.
|
||||||
|
if (element.hasOwnProperty("attributes")) {
|
||||||
for (const attr of element.attributes) {
|
for (const attr of element.attributes) {
|
||||||
if (attr.name === "role" && attr.value === "application") {
|
if (attr.name === "role" && attr.value === "application") {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue