Offline, privacy-first grammar checker. Fast, open-source, Rust-powered
feat(chrome-ext): surface update instructions (#2873)
Elijah Potter1d67d12e9831
diff --git a/packages/chrome-plugin/src/detectBrowserEngine.ts b/packages/chrome-plugin/src/detectBrowserEngine.tsnew file mode 100644index 000000000..e13f0c57d--- /dev/null+++ b/packages/chrome-plugin/src/detectBrowserEngine.ts@@ -0,0 +1,6 @@+export default function detectBrowserEngine() {+ // @ts-expect-error+ if (typeof InstallTrigger !== 'undefined') return 'firefox';+ if (typeof window.chrome !== 'undefined') return 'chromium';+ return 'unknown';+}diff --git a/packages/chrome-plugin/src/popup/Popup.svelte b/packages/chrome-plugin/src/popup/Popup.svelteindex d09e11de8..e057deb7b 100644--- a/packages/chrome-plugin/src/popup/Popup.svelte+++ b/packages/chrome-plugin/src/popup/Popup.svelte@@ -4,6 +4,7 @@ import { Button, Link } from 'components';import { onMount } from 'svelte';import Fa from 'svelte-fa';import logo from '/logo.png';+import detectBrowserEngine from '../detectBrowserEngine';import { main, type PopupState } from '../PopupState';import Main from './Main.svelte';import Onboarding from './Onboarding.svelte';@@ -41,6 +42,20 @@ $effect(() => {function openSettings() {chrome.runtime?.openOptionsPage?.();}++function openUpdateHelpPage() {+ let url: string;++ if (detectBrowserEngine() == 'chromium') {+ url = 'https://writewithharper.com/docs/integrations/chrome-extension#Updating-the-Extension';+ } else {+ url = 'https://writewithharper.com/docs/integrations/firefox-extension#Updating-the-Extension';+ }++ chrome.tabs.create({+ url,+ });+}</script><div class="w-[340px] border border-gray-200 font-sans flex flex-col rounded-lg shadow-sm select-none dark:border-slate-800 dark:text-slate-100">@@ -55,9 +70,9 @@ function openSettings() {popupState = main();}}><Fa icon={faArrowLeft}/></Button>{:else}- <div>+ <div onclick={openUpdateHelpPage}>{#if versionMismatch}- <span class="ml-1" title={`Newer version available: ${latestVersion ?? ''}`}>⚠️</span>+ <span class="ml-1" title={`Newer version available: ${latestVersion ?? ''}. Click to find out more.`}>⚠️</span>{/if}<span class="text-sm font-mono">{version}</span></div>diff --git a/packages/web/src/routes/docs/integrations/chrome-extension/+page.md b/packages/web/src/routes/docs/integrations/chrome-extension/+page.mdindex ed17c153d..7e3091ef0 100644--- a/packages/web/src/routes/docs/integrations/chrome-extension/+page.md+++ b/packages/web/src/routes/docs/integrations/chrome-extension/+page.md@@ -11,3 +11,19 @@ We help improve the prose and grammar of your emails, messages, and documents, aTo install it, visit the [Chrome Web Store](https://chromewebstore.google.com/detail/private-grammar-checking/lodbfhdipoipcjmlebjbgmmgekckhpfb) and click 'Add to Chrome'.For our nerdy friends out there, you'll be happy to hear the Chrome extension is powered by [`harper.js`](/docs/harperjs/introduction).++## Updating the Extension++We're constantly improving our grammar engine and introducing new features to our Chrome Extension.+To get the best experience with Harper, make sure your installation is up-to-date.++Your browser will automatically update the extension to the latest version as soon as it is available.+If it is delayed, you can initiate a manual update yourself by:++1. Navigating to `chrome://extensions`.+1. Enabling Developer mode using the toggle in the top-right corner.+1. Clicking the Update button that appears.++Be advised: Google's review process is often slower than other integrations (for example, Obsidian).+This means that Chrome Extension updates are usually delayed by a few days compared to everything else.+We appreciate your patience.diff --git a/packages/web/src/routes/docs/integrations/firefox-extension/+page.md b/packages/web/src/routes/docs/integrations/firefox-extension/+page.mdindex 25d12d89c..8baed7a7b 100644--- a/packages/web/src/routes/docs/integrations/firefox-extension/+page.md+++ b/packages/web/src/routes/docs/integrations/firefox-extension/+page.md@@ -11,3 +11,11 @@ Emails, chat messages, blog posts, and comments benefit from real-time grammar iTo install, head to the [Firefox Add-ons site](https://addons.mozilla.org/en-US/firefox/addon/private-grammar-checker-harper/) and select 'Add to Firefox'.Curious how it works? The Firefox extension runs entirely on [`harper.js`](/docs/harperjs/introduction), our open-source JavaScript library.++## Updating the Extension++We're constantly improving our grammar engine and introducing new features to our Firefox Extension.+To get the best experience with Harper, make sure your installation is up-to-date.++Your browser will automatically update the extension to the latest version as soon as it is available.+If it is delayed, you can initiate a manual update yourself by following [this guide](https://support.mozilla.org/en-US/kb/how-update-add-ons).