use browser extension to open tab in background (#1074)

This commit is contained in:
Athou
2023-06-10 22:16:02 +02:00
parent e2eeba90ef
commit 22e0f1f382
37 changed files with 717 additions and 325 deletions

View File

@@ -97,5 +97,6 @@ export const Constants = {
mainScrollAreaId: "main-scroll-area-id",
entryId: (entry: Entry) => `entry-id-${entry.id}`,
},
browserExtensionUrl: "https://github.com/Athou/commafeed-browser-extension",
bitcoinWalletAddress: "1dymfUxqCWpyD7a6rQSqNy4rLVDBsAr5e",
}

View File

@@ -52,17 +52,4 @@ export const scrollToWithCallback = ({
element.scrollTo(options)
}
export const openLinkInBackgroundTab = (url: string) => {
// simulate ctrl+click to open tab in background
const a = document.createElement("a")
a.href = url
a.rel = "noreferrer"
a.dispatchEvent(
new MouseEvent("click", {
ctrlKey: true,
metaKey: true,
})
)
}
export const truncate = (str: string, n: number) => (str.length > n ? `${str.slice(0, n - 1)}\u2026` : str)