Skip to content

Full Toolkit for Next-Level Domain Analysis

Add "Shortcuts" dialog an Raycast quicklink πŸ”—

Felix Wotschofskyec66611e4d8e
diff --git a/app/_components/bookmarklet-link.tsx b/app/_components/bookmarklet-link.tsx
index dd9784f..ec3d576 100644
--- a/app/_components/bookmarklet-link.tsx
+++ b/app/_components/bookmarklet-link.tsx
@@ -1,26 +1,18 @@
'use client';
-import {
- type FC,
- type MouseEventHandler,
- useCallback,
- useEffect,
- useState,
-} from 'react';
+import { BookmarkIcon, DownloadIcon, ExternalLinkIcon } from 'lucide-react';
+import { type FC, type MouseEventHandler, useCallback, useState } from 'react';
import {
AlertDialog,
AlertDialogCancel,
AlertDialogContent,
- AlertDialogDescription,
AlertDialogFooter,
- AlertDialogHeader,
- AlertDialogTitle,
} from '@/components/ui/alert-dialog';
+import { Button } from '@/components/ui/button';
export const BookmarkletLink: FC = () => {
const [isOpen, setIsOpen] = useState(false);
- const [pressed, setPressed] = useState(false);
const applyScript = useCallback((element: HTMLAnchorElement | null) => {
if (!element) return;
@@ -51,50 +43,91 @@ export const BookmarkletLink: FC = () => {
[setIsOpen],
);
- const mouseDownHandler = useCallback<
- MouseEventHandler<HTMLAnchorElement>
- >(() => {
- setPressed(true);
- }, [setPressed]);
-
- useEffect(() => {
- const handler = () => {
- setPressed(false);
- };
-
- window.addEventListener('mouseup', handler);
- window.addEventListener('dragend', handler);
-
- return () => {
- window.removeEventListener('mouseup', handler);
- window.removeEventListener('dragend', handler);
- };
- });
-
return (
<>
<a
- ref={applyScript}
className="cursor-pointer text-center"
onClick={clickHandler}
- onMouseDown={mouseDownHandler}
tabIndex={-1}
>
- {pressed ? 'Inspect Domain' : 'Bookmarklet'}
+ Shortcuts
</a>
<AlertDialog open={isOpen} onOpenChange={setIsOpen}>
<AlertDialogContent>
- <AlertDialogHeader>
- <AlertDialogTitle>Installation required</AlertDialogTitle>
- <AlertDialogDescription>
- This link is a bookmarklet intended to be dragged into your
- browser&apos;s bookmark bar. It can be clicked from anywhere to
- open the results page for the site you are currently on.
- </AlertDialogDescription>
- </AlertDialogHeader>
+ <div className="space-y-6">
+ <section>
+ <div className="mb-3 flex items-center gap-2">
+ <BookmarkIcon className="size-4" />
+ <h3 className="font-semibold">Bookmarklet</h3>
+ </div>
+ <p className="mb-3 text-sm text-zinc-500 dark:text-zinc-400">
+ Drag the link below to your bookmarks bar. When clicked on any
+ site, it opens Domain Digger results for the current domain in a
+ new tab.
+ </p>
+ <Button
+ asChild
+ className="bg-background hover:bg-muted/50 inline-flex cursor-grab items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition-colors active:cursor-grabbing"
+ draggable
+ >
+ <a ref={applyScript}>
+ <BookmarkIcon className="size-3" />
+ Inspect Domain
+ </a>
+ </Button>
+ </section>
+
+ <hr className="border-border" />
+
+ <section>
+ <div className="mb-3 flex items-center gap-2">
+ <DownloadIcon className="size-4" />
+ <h3 className="font-semibold">Raycast Quicklink</h3>
+ </div>
+ <p className="mb-3 text-sm text-zinc-500 dark:text-zinc-400">
+ If you use Raycast, add a Quicklink to search domains with a
+ keyboard shortcut.
+ </p>
+ <div className="space-y-2 text-sm">
+ <div>
+ <span className="text-zinc-500 dark:text-zinc-400">
+ 1. Download:
+ </span>{' '}
+ <a
+ className="underline decoration-dotted underline-offset-4"
+ href="/assets/shortcuts/raycast.json"
+ download
+ >
+ raycast.json
+ </a>
+ </div>
+ <div>
+ <span className="text-zinc-500 dark:text-zinc-400">2.</span>{' '}
+ In Raycast β†’ <strong>Quicklinks</strong> β†’{' '}
+ <strong>Import</strong>, choose the downloaded file
+ </div>
+ <div>
+ <span className="text-zinc-500 dark:text-zinc-400">3.</span>{' '}
+ Trigger Raycast and type &quot;Domain Digger&quot;
+ </div>
+ <div className="pt-1">
+ <a
+ className="inline-flex items-center gap-1 text-xs underline decoration-dotted underline-offset-4"
+ href="https://www.raycast.com/core-features/quicklinks"
+ target="_blank"
+ rel="noreferrer"
+ >
+ Learn more about Quicklinks
+ <ExternalLinkIcon className="size-3" />
+ </a>
+ </div>
+ </div>
+ </section>
+ </div>
+
<AlertDialogFooter>
- <AlertDialogCancel>Ok</AlertDialogCancel>
+ <AlertDialogCancel>Close</AlertDialogCancel>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
diff --git a/public/assets/shortcuts/raycast.json b/public/assets/shortcuts/raycast.json
new file mode 100644
index 0000000..4901dbe
--- /dev/null
+++ b/public/assets/shortcuts/raycast.json
@@ -0,0 +1,6 @@
+[
+ {
+ "link": "https://digger.tools/?q={Search}&ref=raycast",
+ "name": "Domain Digger"
+ }
+]