Add an opt-in context menu for files and directories

Apps set browser.contextMenu to a list of { label, action, when?, danger? }
items; when(entry, path) scopes an item to directories, files, or any
other match. Right-click, the Menu key, or a touch long press opens it.
The demo adds sample items, including a .json-only one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-23 18:50:21 -07:00
co-authored by Claude Opus 5.5
parent 13e2654415
commit d8b8012e40
12 changed files with 292 additions and 18 deletions
+3 -2
View File
@@ -6,12 +6,13 @@
<meta name="color-scheme" content="light">
<meta name="theme-color" content="#ffffff">
<title>octopus-file-browser</title>
<script type="module" crossorigin src="/assets/index-CRttpLjx.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-rQJBLWWV.css">
<script type="module" crossorigin src="/assets/index-BJSID0yX.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-Bx92WdqS.css">
</head>
<body>
<main>
<octopus-file-browser></octopus-file-browser>
<p class="demo-status" role="status">Right-click or long-press a file or folder.</p>
</main>
</body>
</html>