mirror of
https://github.com/vale981/tridactyl
synced 2025-03-04 17:11:40 -05:00
Cheer up prettier
This commit is contained in:
parent
cff50597bf
commit
3fe9575a33
1 changed files with 13 additions and 15 deletions
|
@ -14,9 +14,11 @@ export function getTriVersion() {
|
|||
|
||||
// version_name only really exists in Chrome
|
||||
// but we're using it anyway for our own purposes
|
||||
return (manifest as browser._manifest.WebExtensionManifest & {
|
||||
version_name: string
|
||||
}).version_name
|
||||
return (
|
||||
manifest as browser._manifest.WebExtensionManifest & {
|
||||
version_name: string
|
||||
}
|
||||
).version_name
|
||||
}
|
||||
|
||||
export function getPrettyTriVersion() {
|
||||
|
@ -77,10 +79,7 @@ export async function activeWindowId() {
|
|||
}
|
||||
|
||||
export async function removeActiveWindowValue(value) {
|
||||
browserBg.sessions.removeWindowValue(
|
||||
await activeWindowId(),
|
||||
value,
|
||||
)
|
||||
browserBg.sessions.removeWindowValue(await activeWindowId(), value)
|
||||
}
|
||||
|
||||
export async function activeTabContainerId() {
|
||||
|
@ -285,7 +284,9 @@ export async function queryAndURLwrangler(
|
|||
const expandRecursively = (name, dict, prevExpansions = []) => {
|
||||
if (name in dict) {
|
||||
if (prevExpansions.includes(name)) {
|
||||
throw new Error(`Infinite loop detected while expanding ${name}. Stack: ${prevExpansions}.`)
|
||||
throw new Error(
|
||||
`Infinite loop detected while expanding ${name}. Stack: ${prevExpansions}.`,
|
||||
)
|
||||
}
|
||||
prevExpansions.push(name)
|
||||
return expandRecursively(dict[name], dict, prevExpansions)
|
||||
|
@ -296,10 +297,7 @@ export async function queryAndURLwrangler(
|
|||
const searchurls = config.get("searchurls")
|
||||
const template = expandRecursively(firstWord, searchurls)
|
||||
if (template != firstWord) {
|
||||
const url = UrlUtil.interpolateSearchItem(
|
||||
new URL(template),
|
||||
rest,
|
||||
)
|
||||
const url = UrlUtil.interpolateSearchItem(new URL(template), rest)
|
||||
// firstWord is a searchurl, so let's use that
|
||||
return url.href
|
||||
}
|
||||
|
@ -380,7 +378,7 @@ export async function openInTab(tab, opts = {}, strarr: string[]) {
|
|||
* @param tabId tab identifier
|
||||
*/
|
||||
export async function goToTab(tabId: number) {
|
||||
const tab = await browserBg.tabs.update(tabId, { active: true });
|
||||
await browserBg.windows.update(tab.windowId, { focused: true });
|
||||
return tab;
|
||||
const tab = await browserBg.tabs.update(tabId, { active: true })
|
||||
await browserBg.windows.update(tab.windowId, { focused: true })
|
||||
return tab
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue