Skip to content

Commit 24e9bc6

Browse files
committed
feat: 原始线索面板加复制按钮
footer-panel-head 在 raw 模式下显示复制按钮,把当前 rawOutputText 写入剪贴板,placeholder 与加载文案不响应。 将版本号提升到 1.2.8。
1 parent cca2b78 commit 24e9bc6

2 files changed

Lines changed: 33 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stackprism",
33
"private": true,
4-
"version": "1.2.7",
4+
"version": "1.2.8",
55
"type": "module",
66
"description": "StackPrism 用于检测网页前端、后端、CDN、SaaS、广告营销、统计、登录、支付、网站程序和主题模板线索。",
77
"scripts": {

src/ui/popup/Popup.vue

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,14 @@
160160
<span class="footer-panel-title">
161161
{{ footerPanel === 'search' ? '网页源代码搜索' : rawPanelTitle }}
162162
</span>
163-
<RippleButton class="footer-panel-close" title="关闭面板" @click="closeFooterPanel">
164-
<X :size="14" :stroke-width="2" />
165-
</RippleButton>
163+
<div class="footer-panel-actions">
164+
<RippleButton v-if="footerPanel === 'raw'" class="footer-panel-copy" title="复制原始线索" @click="copyRawOutput">
165+
<Copy :size="12" :stroke-width="2" />
166+
</RippleButton>
167+
<RippleButton class="footer-panel-close" title="关闭面板" @click="closeFooterPanel">
168+
<X :size="14" :stroke-width="2" />
169+
</RippleButton>
170+
</div>
166171
</header>
167172
<div v-if="footerPanel === 'search'" class="footer-panel-body">
168173
<div class="search-row">
@@ -666,6 +671,20 @@
666671
}
667672
}
668673
674+
const copyRawOutput = async () => {
675+
const text = rawOutputText.value
676+
if (!text || text === RAW_PLACEHOLDER || text === RAW_LOADING_TEXT) {
677+
setStatus('暂无可复制的原始线索。')
678+
return
679+
}
680+
try {
681+
await navigator.clipboard.writeText(text)
682+
setStatus('已复制原始线索。')
683+
} catch (error: any) {
684+
setStatus(`复制失败:${String(error?.message || error)}`)
685+
}
686+
}
687+
669688
const getRawResult = async () => {
670689
if (state.rawLoaded) return state.rawResult
671690
const tabId = state.currentTabId || (await getActiveTabId())
@@ -1588,7 +1607,14 @@
15881607
text-transform: uppercase;
15891608
}
15901609
1591-
.footer-panel-close {
1610+
.footer-panel-actions {
1611+
display: inline-flex;
1612+
flex-shrink: 0;
1613+
gap: 4px;
1614+
}
1615+
1616+
.footer-panel-close,
1617+
.footer-panel-copy {
15921618
align-items: center;
15931619
background: transparent;
15941620
border: 0;
@@ -1605,7 +1631,8 @@
16051631
width: 22px;
16061632
}
16071633
1608-
.footer-panel-close:hover {
1634+
.footer-panel-close:hover,
1635+
.footer-panel-copy:hover {
16091636
background: var(--accent-soft);
16101637
color: var(--accent);
16111638
}

0 commit comments

Comments
 (0)