mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Never throw when opening commandline
This is a hack to stop logger.error loops on pages that cannot open the commandline (e.g. svgs).
This commit is contained in:
parent
f87ffbec93
commit
f4a9fdfc64
1 changed files with 8 additions and 8 deletions
|
@ -51,29 +51,29 @@ if (document.readyState === "complete") {
|
|||
}
|
||||
|
||||
export function show() {
|
||||
if (enabled) {
|
||||
try {
|
||||
const height =
|
||||
cmdline_iframe.contentWindow.document.body.offsetHeight + "px"
|
||||
cmdline_iframe.setAttribute("style", `height: ${height} !important;`)
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
export function hide() {
|
||||
if (enabled) {
|
||||
try {
|
||||
cmdline_iframe.setAttribute("style", "height: 0px !important;")
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
export function focus() {
|
||||
if (enabled) {
|
||||
try {
|
||||
cmdline_iframe.focus()
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
export function blur() {
|
||||
if (enabled) {
|
||||
try {
|
||||
cmdline_iframe.blur()
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
export function executeWithoutCommandLine(fn) {
|
||||
|
|
Loading…
Add table
Reference in a new issue