@jidekaixin2dian/dsh-file-actions 0.1.19 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/README.en.md +25 -7
- package/README.md +25 -7
- package/assets/preview-conversation-files.png +0 -0
- package/assets/preview-conversation-open-with.png +0 -0
- package/assets/preview-conversation.png +0 -0
- package/assets/preview-video.png +0 -0
- package/lib/client.js +74 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.20 — 2026-11-06
|
|
4
|
+
|
|
5
|
+
- 修复右键「已编辑 …」文件变更卡片无反应:卡片每行的已解析路径由宿主写在
|
|
6
|
+
`aria-describedby` 指向的隐藏节点里,直接读取即可,不解析本地化按钮文案;
|
|
7
|
+
悬停差异预览则读 `data-changes-preview-path`。
|
|
8
|
+
- Fix the dead right-click on "edited …" changed-file cards: each row's
|
|
9
|
+
resolved path is published by the host in the hidden `aria-describedby`
|
|
10
|
+
target, so read that instead of parsing localized labels; the hover diff
|
|
11
|
+
preview exposes `data-changes-preview-path`.
|
|
12
|
+
- 修复右键指向图片的 Markdown 链接无反应:宿主把图片渲染成自带预览按钮而非
|
|
13
|
+
`<a href>`,现从内部 `<img>` 的 `/api/file?path=…` 文件路由 URL 解析出绝对
|
|
14
|
+
路径(issue #16、#17)。
|
|
15
|
+
- Fix the dead right-click on Markdown links pointing at images: the host
|
|
16
|
+
renders them as its own preview button rather than `<a href>`; the absolute
|
|
17
|
+
path is now recovered from the inner `<img>`'s `/api/file?path=…` file-route
|
|
18
|
+
URL (issues #16, #17).
|
|
19
|
+
|
|
20
|
+
- 设置页导航图标迁移到官方 `settings.section.icon` 槽位(DSH 0.2.2 新增,按分区 id
|
|
21
|
+
匹配),插件卸载后还原默认图标;未声明该槽位的宿主(rc.2–rc.5)自动回退到原有
|
|
22
|
+
DOM 装饰方式,行为不变。
|
|
23
|
+
- Migrate the settings navigation icon to the official `settings.section.icon`
|
|
24
|
+
slot (new in DSH 0.2.2, matched by section id) with clean unregistration;
|
|
25
|
+
hosts that do not declare the slot (rc.2–rc.5) keep the previous DOM
|
|
26
|
+
decoration fallback unchanged.
|
|
27
|
+
- 兼容验证扩展到 DSH 0.2.2-alpha.3 与 0.2.2-rc.1:0.2.2 系列引入统一右键菜单等
|
|
28
|
+
客户端变化,43 项宿主套件在两档宿主全部通过,右键菜单共存无冲突;rc.5 仍是
|
|
29
|
+
默认固定宿主,保留 rc.2–rc.4 回归。
|
|
30
|
+
- Extend verified host coverage to DSH 0.2.2-alpha.3 and 0.2.2-rc.1. The 0.2.2
|
|
31
|
+
line introduces a unified context menu and other client changes; the 43-item
|
|
32
|
+
host suite passes on both hosts with the right-click behavior coexisting, and
|
|
33
|
+
rc.5 stays the default pinned host with rc.2–rc.4 retained.
|
|
34
|
+
- 「在浏览器中打开」的非活动内容窗口收紧 sandbox:媒体、图片与纯文本不再授予
|
|
35
|
+
`allow-scripts`,仅内置 PDF 查看器保留脚本上下文;opaque origin 不变。
|
|
36
|
+
- Tighten the browser-preview sandbox for non-active content: media, images and
|
|
37
|
+
plain text no longer get `allow-scripts`; only the built-in PDF viewer keeps a
|
|
38
|
+
scripting context. The opaque origin is unchanged.
|
|
39
|
+
- 宿主套件加固:全局测试超时与重量级 runtime 用例超时上调,toast 断言改为对
|
|
40
|
+
事件记录轮询——Windows CI runner 停顿不再被误判为失败;断言语义不变。
|
|
41
|
+
- Harden the host suite: longer global and heavy-runtime-test budgets, and toast
|
|
42
|
+
assertions that poll a recorded log, so stalled Windows CI runners no longer
|
|
43
|
+
read as failures; assertions are unchanged.
|
|
44
|
+
|
|
3
45
|
## 0.1.19 — 2026-10-31
|
|
4
46
|
|
|
5
47
|
- 设置页新增中英文「项目与反馈」区域,可打开 File Actions GitHub 项目或新建反馈。
|
package/README.en.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# File Actions · 文件与链接操作
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Right-click a file from your agent's conversation to open, preview or use it.**
|
|
4
4
|
|
|
5
5
|
[中文](README.md) · [npm](https://www.npmjs.com/package/@jidekaixin2dian/dsh-file-actions/v/0.1.19) · [Marketplace](https://awesome-dsh-plugin.com/p/jidekaixin2dian/dsh-file-actions/) · [Download](https://github.com/jidekaixin2dian/dsh-file-actions/releases/latest) · [Changelog](CHANGELOG.md)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
File Actions is a file and link context-menu plugin for DeepSeek Harness (DSH). Right-click a file reference or delivery card in an agent conversation to open, reveal, preview, copy or save it. The menu also supports tool results and sidebars that expose file paths.
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
@@ -17,17 +17,35 @@ Once a model gives you a file, the next step is usually to open it, keep editing
|
|
|
17
17
|
| View and export | Preview supported documents and media, copy text, save a local file |
|
|
18
18
|
| Share a link | Open, copy the URL or text, copy as Markdown |
|
|
19
19
|
|
|
20
|
+
## Image, video and file-reference previews
|
|
21
|
+
|
|
22
|
+
- **Image preview:** right-click an image reference to see an available thumbnail in the menu; click the thumbnail to enlarge it. Thumbnail reads are limited to 8 MiB.
|
|
23
|
+
- **Video preview:** the menu can show a thumbnail extracted from a video. Open supported formats in the browser to play the full video. Thumbnails depend on browser decoding and are unavailable for files over 8 MiB or when decoding fails; browser previews and saved copies are limited to 64 MiB.
|
|
24
|
+
- **Continue editing a delivered file:** use **Open with** from its conversation reference to search associated applications and save a preference by file type without changing OS defaults.
|
|
25
|
+
- **Code reference context:** when a reference retains line numbers, preview the referenced lines and surrounding context or copy the excerpt with its source path. These actions cannot recover line numbers hidden by the host.
|
|
26
|
+
- **Paths, text and links:** copy absolute or relative paths, filenames, valid UTF-8 text and referenced lines; copy a web link's URL, text or Markdown. File-content and referenced-line reads are limited to 2 MiB.
|
|
27
|
+
- **Keyboard and menu settings:** open the menu with `Shift+F10` and navigate with arrows and Enter. Choose a full or compact menu and adjust the number of context lines in reference previews.
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+

|
|
32
|
+
|
|
33
|
+
Screenshots are from an earlier isolated demonstration environment; the interface may change between versions.
|
|
34
|
+
|
|
20
35
|
## Downloads
|
|
21
36
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
|
37
|
+
As of **2026-10-31**, the File Actions npm package and GitHub Release archives have received **2,000+ download requests** combined:
|
|
38
|
+
|
|
39
|
+
| Source | Scope | Requests |
|
|
40
|
+
|---|---|---:|
|
|
41
|
+
| [npm package](https://api.npmjs.org/downloads/point/2026-10-23:2026-10-31/@jidekaixin2dian%2Fdsh-file-actions) | All versions, 2026-10-23 through 2026-10-31 | 1,799 |
|
|
42
|
+
| [GitHub Releases](https://api.github.com/repos/jidekaixin2dian/dsh-file-actions/releases?per_page=100) | `dsh-file-actions.tgz` across all releases, excluding checksums | 440 |
|
|
25
43
|
|
|
26
|
-
|
|
44
|
+
This is a sum of requests across two channels. It may include repeat installs and automation and **does not represent unique users or deduplicated installs**. Counts are a snapshot; the links provide the npm date-range total and individual GitHub asset counts.
|
|
27
45
|
|
|
28
46
|
## Install and update
|
|
29
47
|
|
|
30
|
-
Requires **DSH >=0.2.1-rc.2 and Node >=24**. CI verifies DSH rc.2 / rc.3 / rc.4 / rc.5.
|
|
48
|
+
Requires **DSH >=0.2.1-rc.2 and Node >=24**. CI verifies DSH rc.2 / rc.3 / rc.4 / rc.5 / 0.2.2-alpha.3 / 0.2.2-rc.1.
|
|
31
49
|
|
|
32
50
|
Search for **dsh-file-actions** in the marketplace and verify author **jidekaixin2dian**. Existing users can check updates under installed plugins. Catalog and registry mirrors may take time to refresh.
|
|
33
51
|
|
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# 文件与链接操作 · File Actions
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**在对话里右键 Agent 给出的文件,打开、预览或继续处理。**
|
|
4
4
|
|
|
5
5
|
[English](README.en.md) · [npm](https://www.npmjs.com/package/@jidekaixin2dian/dsh-file-actions/v/0.1.19) · [插件市场](https://awesome-dsh-plugin.com/p/jidekaixin2dian/dsh-file-actions/) · [下载](https://github.com/jidekaixin2dian/dsh-file-actions/releases/latest) · [更新记录](CHANGELOG.md)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
File Actions 是 DeepSeek Harness(DSH)的文件和链接右键插件。Agent 在对话中给出文件后,直接右键文件引用或交付卡片,就能从插件菜单打开、定位、预览、复制或另存;也支持工具结果及提供文件路径的侧栏。
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
@@ -17,17 +17,35 @@
|
|
|
17
17
|
| 查看与带走内容 | 预览支持的文档、图片或媒体;复制文本;另存为本地文件 |
|
|
18
18
|
| 分享链接 | 打开网页,复制链接、链接文字或 Markdown |
|
|
19
19
|
|
|
20
|
+
## 图片、视频与文件引用
|
|
21
|
+
|
|
22
|
+
- **图片预览**:右键图片引用,菜单内显示可用的缩略图;点击缩略图可以放大查看,不必先切换到图片应用。缩略图读取上限为 8 MiB。
|
|
23
|
+
- **视频预览**:右键视频引用,可在菜单中查看从视频提取的画面缩略图;支持的格式还能通过「在浏览器中打开」播放完整视频。缩略图依赖浏览器解码,文件超过 8 MiB 或无法解码时不会显示;浏览器预览及另存上限为 64 MiB。
|
|
24
|
+
- **交付文件接着编辑**:从当前对话的文件引用进入「打开方式」,搜索系统关联的应用并按文件类型收藏首选,不修改系统默认应用。
|
|
25
|
+
- **代码引用上下文**:保留行号的引用可只读查看引用行及前后文,也可复制引用片段和来源路径;宿主未暴露行号时无法使用这些操作。
|
|
26
|
+
- **路径、正文与链接**:复制绝对或相对路径、文件名、有效 UTF-8 文本与引用行;网页链接可复制地址、文字或 Markdown。文件内容和引用行限 2 MiB。
|
|
27
|
+
- **键盘操作与菜单设置**:用 `Shift+F10` 打开菜单,方向键与 Enter 选择执行;可切换完整或精简菜单,并调整引用预览的前后文行数。
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+

|
|
32
|
+
|
|
33
|
+
图片来自此前的隔离演示环境;界面会随版本变化。
|
|
34
|
+
|
|
20
35
|
## 下载情况
|
|
21
36
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
|
37
|
+
截至 **2026-10-31**,File Actions 的 npm 包与 GitHub Release 安装包合计 **2,000+ 次下载请求**:
|
|
38
|
+
|
|
39
|
+
| 来源 | 统计范围 | 请求次数 |
|
|
40
|
+
|---|---|---:|
|
|
41
|
+
| [npm 包](https://api.npmjs.org/downloads/point/2026-10-23:2026-10-31/@jidekaixin2dian%2Fdsh-file-actions) | 2026-10-23 至 2026-10-31,全部版本 | 1,799 |
|
|
42
|
+
| [GitHub Release](https://api.github.com/repos/jidekaixin2dian/dsh-file-actions/releases?per_page=100) | 全部版本的 `dsh-file-actions.tgz`,不含校验文件 | 440 |
|
|
25
43
|
|
|
26
|
-
|
|
44
|
+
这是两种渠道的请求次数之和,可能包含重复安装与自动化请求,**不代表独立用户数或去重安装量**。数字为当日快照;来源链接分别提供 npm 区间统计和 GitHub 各资源计数。
|
|
27
45
|
|
|
28
46
|
## 安装与更新
|
|
29
47
|
|
|
30
|
-
需要 **DSH >=0.2.1-rc.2、Node >=24**;持续验证 DSH rc.2 / rc.3 / rc.4 / rc.5。
|
|
48
|
+
需要 **DSH >=0.2.1-rc.2、Node >=24**;持续验证 DSH rc.2 / rc.3 / rc.4 / rc.5 / 0.2.2-alpha.3 / 0.2.2-rc.1。
|
|
31
49
|
|
|
32
50
|
在插件市场搜索 **dsh-file-actions**,确认作者为 **jidekaixin2dian** 后安装;已有用户在「已安装」中检查更新。市场数据与 npm 镜像可能有同步延迟。
|
|
33
51
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/client.js
CHANGED
|
@@ -1138,6 +1138,7 @@ const factory = (require) => {
|
|
|
1138
1138
|
.dfa-settings-app-info{min-width:0;display:flex;align-items:center;gap:12px;flex:1}.dfa-settings-app-info strong{display:inline-block;min-width:56px;padding:4px 7px;border-radius:5px;background:color-mix(in srgb,var(--dfa-accent) 7%,transparent);color:var(--dfa-accent);font:500 .73rem/1.5 Consolas,monospace}.dfa-settings-app-info span{overflow-wrap:anywhere;font-size:.8rem}.dfa-settings-empty{display:flex;align-items:center;gap:12px;padding:15px 16px 19px}.dfa-settings-empty>svg{flex:none;opacity:.4;width:25px;height:25px}.dfa-settings-empty strong{display:block;font-size:.8rem;font-weight:500;margin-bottom:4px}
|
|
1139
1139
|
.dfa-settings-cache{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:13px 4px 15px}.dfa-settings-cache-title{display:flex;gap:7px;align-items:center;font-size:.8rem;font-weight:550;margin-bottom:4px}.dfa-settings-cache-title>svg{opacity:.5}.dfa-settings-cache button{display:flex;align-items:center;gap:7px;white-space:nowrap;font-size:.76rem}.dfa-settings-footer{padding:12px 4px 0;border-top:1px solid var(--dfa-line);display:flex;align-items:flex-start;gap:7px;font-size:.72rem;line-height:1.6;opacity:.55}.dfa-settings-footer svg{width:13px;height:13px;flex:none;margin-top:2px}.dfa-settings-status{min-height:1.5em;margin-top:8px;font-size:.76rem;padding:0 4px;overflow-wrap:anywhere}.dfa-settings-status[data-error="true"]{color:var(--dsw-alias-danger,#b42318)}
|
|
1140
1140
|
button[data-dfa-nav-icon="file-actions"]>svg{display:none}button[data-dfa-nav-icon="file-actions"]::before{content:"";width:16px;height:16px;flex:none;background:currentColor;mask: url("data:image/svg+xml,${encodeURIComponent(iconSvg('fileActions').replace('<svg ', '<svg xmlns="http://www.w3.org/2000/svg" '))}") center/contain no-repeat}
|
|
1141
|
+
.dfa-nav-icon{display:inline-flex;flex:none}.dfa-nav-icon>svg{width:100%;height:100%}
|
|
1141
1142
|
@media(max-width:500px){.dfa-settings-header{gap:10px;margin-bottom:18px}.dfa-settings h2{font-size:1rem}.dfa-settings-row{padding:13px 14px;gap:10px;align-items:flex-start;flex-wrap:wrap}.dfa-settings-copy{flex-basis:140px}.dfa-settings select{min-width:0;max-width:100%;font-size:.78rem}.dfa-settings-card-head,.dfa-settings-app{padding-left:14px;padding-right:14px}.dfa-settings-app-info{gap:8px}.dfa-settings-app-info strong{min-width:48px}.dfa-settings-cache{align-items:flex-start;flex-wrap:wrap}.dfa-settings-cache>div{flex-basis:180px;flex-grow:1}}
|
|
1142
1143
|
|
|
1143
1144
|
.dfa-toast{position:fixed;left:50%;bottom:32px;transform:translateX(-50%);z-index:2147483002;
|
|
@@ -1397,6 +1398,21 @@ button[data-dfa-nav-icon="file-actions"]>svg{display:none}button[data-dfa-nav-ic
|
|
|
1397
1398
|
* data attribute the GUI already writes) win; a bare text token is the
|
|
1398
1399
|
* fallback for surfaces that only render the path as text.
|
|
1399
1400
|
*/
|
|
1401
|
+
/** Chat media renders as Host file-route URLs: the absolute path is the
|
|
1402
|
+
* `path` query parameter. Web (`https://…/api/file`) and Desktop
|
|
1403
|
+
* (`dsh-app://app/api/file`) share the route name. */
|
|
1404
|
+
function pathFromMediaUrl(value) {
|
|
1405
|
+
if (!value) return ''
|
|
1406
|
+
try {
|
|
1407
|
+
const url = new URL(value, location.href)
|
|
1408
|
+
if (!url.pathname.endsWith('/api/file')) return ''
|
|
1409
|
+
const path = url.searchParams.get('path') || ''
|
|
1410
|
+
return path && isAbsolutePath(path) && !/^[/\\]{2}/.test(path) ? path : ''
|
|
1411
|
+
} catch {
|
|
1412
|
+
return ''
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1400
1416
|
function candidateFromEvent(event, doc) {
|
|
1401
1417
|
const target = event.target
|
|
1402
1418
|
if (!target || !target.closest) return null
|
|
@@ -1423,6 +1439,28 @@ button[data-dfa-nav-icon="file-actions"]>svg{display:none}button[data-dfa-nav-ic
|
|
|
1423
1439
|
}
|
|
1424
1440
|
}
|
|
1425
1441
|
|
|
1442
|
+
// The changed-files card keeps every row's resolved path in a hidden
|
|
1443
|
+
// `aria-describedby` target — locale-proof, unlike the button labels. The
|
|
1444
|
+
// hover diff preview is a portal outside the card and names its file
|
|
1445
|
+
// through a dedicated path span.
|
|
1446
|
+
const trigger = target.closest('[data-changed-files] button[aria-describedby]')
|
|
1447
|
+
if (trigger) {
|
|
1448
|
+
const described = trigger.getAttribute('aria-describedby')
|
|
1449
|
+
const describedNode = described && doc.getElementById(described)
|
|
1450
|
+
const value = describedNode && describedNode.textContent.trim()
|
|
1451
|
+
if (value && looksLikePath(value)) {
|
|
1452
|
+
return { path: value, source: 'changed-files', element: trigger }
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
const preview = target.closest('[data-changes-hover-preview]')
|
|
1456
|
+
if (preview) {
|
|
1457
|
+
const previewPath = preview.querySelector('[data-changes-preview-path]')
|
|
1458
|
+
const previewValue = previewPath && previewPath.textContent.trim()
|
|
1459
|
+
if (previewValue && looksLikePath(previewValue)) {
|
|
1460
|
+
return { path: previewValue, source: 'changed-files', element: preview }
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1426
1464
|
const card = target.closest('[data-presented-file]')
|
|
1427
1465
|
if (card) {
|
|
1428
1466
|
const titled = card.querySelector('[title]')
|
|
@@ -1466,6 +1504,15 @@ button[data-dfa-nav-icon="file-actions"]>svg{display:none}button[data-dfa-nav-ic
|
|
|
1466
1504
|
if (/^[a-z][a-z0-9+.-]*:/i.test(href)) return null
|
|
1467
1505
|
}
|
|
1468
1506
|
|
|
1507
|
+
// Chat markdown images render as the Host's own preview button wrapping an
|
|
1508
|
+
// <img>; the resolved path rides in the file-route URL, not in an attribute.
|
|
1509
|
+
const mediaHolder = target.closest('button')
|
|
1510
|
+
const mediaImg = target.closest('img[src]') || (mediaHolder && mediaHolder.querySelector('img[src]'))
|
|
1511
|
+
if (mediaImg) {
|
|
1512
|
+
const mediaPath = pathFromMediaUrl(mediaImg.getAttribute('src'))
|
|
1513
|
+
if (mediaPath) return { path: mediaPath, source: 'media', element: mediaHolder || mediaImg }
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1469
1516
|
// Inline code in a transcript is a deliberate reference — the blue file names
|
|
1470
1517
|
// the chat renders. Treat it as explicit so a cold right-click opens the menu
|
|
1471
1518
|
// instead of falling through to the browser's own menu. Code inside a fenced
|
|
@@ -1717,8 +1764,9 @@ button[data-dfa-nav-icon="file-actions"]>svg{display:none}button[data-dfa-nav-ic
|
|
|
1717
1764
|
}
|
|
1718
1765
|
}
|
|
1719
1766
|
|
|
1720
|
-
//
|
|
1721
|
-
//
|
|
1767
|
+
// Hosts without the settings.section.icon slot draw a fixed gear for
|
|
1768
|
+
// third-party sections. Decorate only our unique, exact-label row; body
|
|
1769
|
+
// observation is shallow and nav observation stays local.
|
|
1722
1770
|
function settingsNavigationIcon(slots) {
|
|
1723
1771
|
if (typeof document === 'undefined' || typeof MutationObserver === 'undefined') return () => {}
|
|
1724
1772
|
const navObserver = new MutationObserver(() => sync())
|
|
@@ -1765,8 +1813,27 @@ button[data-dfa-nav-icon="file-actions"]>svg{display:none}button[data-dfa-nav-ic
|
|
|
1765
1813
|
name: 'settings.section', id: 'file-actions', order: 19,
|
|
1766
1814
|
label: () => messages(detectLanguage(ctx)).settings.nav,
|
|
1767
1815
|
}, SettingsPage))
|
|
1768
|
-
|
|
1769
|
-
|
|
1816
|
+
// 0.2.2 declares settings.section.icon keyed by the section id. Older hosts
|
|
1817
|
+
// throw "is not declared" from register(): keep the DOM decoration as the
|
|
1818
|
+
// fallback there, and rethrow anything that is not that declaration gap.
|
|
1819
|
+
const disposeIcon = slots.inject('settings.section.icon', () => {
|
|
1820
|
+
try {
|
|
1821
|
+
return slots.register({
|
|
1822
|
+
name: 'settings.section.icon', id: 'file-actions', label: 'File Actions',
|
|
1823
|
+
}, ({ size }) => React.createElement('span', {
|
|
1824
|
+
className: 'dfa-nav-icon', 'aria-hidden': 'true',
|
|
1825
|
+
style: { width: size, height: size },
|
|
1826
|
+
dangerouslySetInnerHTML: { __html: iconSvg('fileActions') },
|
|
1827
|
+
}))
|
|
1828
|
+
} catch (error) {
|
|
1829
|
+
if (!/is not declared/.test(error && error.message || '')) throw error
|
|
1830
|
+
return settingsNavigationIcon(slots)
|
|
1831
|
+
}
|
|
1832
|
+
})
|
|
1833
|
+
return () => {
|
|
1834
|
+
if (typeof disposeIcon === 'function') disposeIcon()
|
|
1835
|
+
if (typeof dispose === 'function') dispose()
|
|
1836
|
+
}
|
|
1770
1837
|
}
|
|
1771
1838
|
|
|
1772
1839
|
class FileMenu {
|
|
@@ -2716,7 +2783,9 @@ button[data-dfa-nav-icon="file-actions"]>svg{display:none}button[data-dfa-nav-ic
|
|
|
2716
2783
|
frame.srcdoc = `<meta http-equiv="Content-Security-Policy" content="${policy}">` + new TextDecoder().decode(bytes)
|
|
2717
2784
|
win.document.body.replaceChildren(bar, frame)
|
|
2718
2785
|
} else {
|
|
2719
|
-
|
|
2786
|
+
// Media, images and plain text render without scripts. The built-in PDF
|
|
2787
|
+
// viewer is the one resident that needs its own scripting context.
|
|
2788
|
+
frame.setAttribute('sandbox', mime === 'application/pdf' ? 'allow-scripts' : '')
|
|
2720
2789
|
frame.src = url
|
|
2721
2790
|
win.document.body.replaceChildren(frame)
|
|
2722
2791
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jidekaixin2dian/dsh-file-actions",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "Act on files and links in chat: open, reveal, preview or save; choose preferred apps, inspect reference context and copy excerpts with their source.",
|
|
5
5
|
"icon": "icon.svg",
|
|
6
6
|
"type": "module",
|