diff options
author | bobzel <zzzman@gmail.com> | 2021-08-30 12:34:13 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-08-30 12:34:13 -0400 |
commit | 1c3b334de7c1a34075b71569e800b7ce7c5d41a5 (patch) | |
tree | b3f8fcb88090d93f45febcd2f26cbb3a8641ab21 /src/Utils.ts | |
parent | 962a1a3f1ae9a55c5aea630d3252cecb740fa15c (diff) |
fixed web pages so that you can type into input fields. changed default webpage to use bing.com url.
Diffstat (limited to 'src/Utils.ts')
-rw-r--r-- | src/Utils.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index 8054245f5..3fffadb6d 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -577,7 +577,7 @@ export function simulateMouseClick(element: Element | null | undefined, x: numbe export function lightOrDark(color: any) { const nonAlphaColor = color.startsWith("#") ? (color as string).substring(0, 7) : - color.startsWith("rgba") ? color.replace(/,.[^,]*\)/, ")").replace("rgba", "rgb") : color; + color.startsWith("rgba") ? color.replace(/,.[^,]*\)/, ")").replace("rgba", "rgb") : color; const col = Color(nonAlphaColor).rgb(); const colsum = (col.red() + col.green() + col.blue()); if (colsum / col.alpha() > 400 || col.alpha() < 0.25) return Colors.DARK_GRAY; @@ -586,6 +586,7 @@ export function lightOrDark(color: any) { export function getWordAtPoint(elem: any, x: number, y: number): string | undefined { + if (elem.tagName === "INPUT") return "input"; if (elem.nodeType === elem.TEXT_NODE) { const range = elem.ownerDocument.createRange(); range.selectNodeContents(elem); |