-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
349 lines (329 loc) · 8.08 KB
/
Copy pathpopup.html
File metadata and controls
349 lines (329 loc) · 8.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SourceMap Extractor</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 480px;
min-height: 320px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #1a1a2e;
color: #e0e0e0;
font-size: 13px;
}
/* Header */
.header {
background: linear-gradient(135deg, #16213e, #0f3460);
padding: 16px 20px;
border-bottom: 1px solid #2a2a4a;
}
.header h1 {
font-size: 16px;
font-weight: 600;
color: #e94560;
letter-spacing: 0.5px;
}
.header .subtitle {
font-size: 11px;
color: #888;
margin-top: 4px;
}
/* Content area */
.content {
padding: 12px 20px 20px;
}
/* Status bar */
.status-bar {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
padding: 10px 14px;
background: #16213e;
border-radius: 8px;
border: 1px solid #2a2a4a;
}
.status-bar .badge {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 13px;
font-weight: 500;
}
.status-bar .badge .dot {
width: 8px;
height: 8px;
border-radius: 50%;
display: inline-block;
}
.dot.red { background: #e74c3c; }
.dot.green { background: #27ae60; }
.dot.yellow { background: #f39c12; }
.dot.gray { background: #666; }
/* Buttons */
.btn-group {
display: flex;
gap: 8px;
margin-bottom: 14px;
}
.btn {
flex: 1;
padding: 10px 12px;
border: none;
border-radius: 8px;
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
}
.btn:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.btn-primary {
background: linear-gradient(135deg, #e94560, #c23152);
color: #fff;
}
.btn-primary:hover:not(:disabled) {
background: linear-gradient(135deg, #ff6b81, #e94560);
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}
.btn-secondary {
background: #16213e;
color: #ccc;
border: 1px solid #2a2a4a;
}
.btn-secondary:hover:not(:disabled) {
background: #1f2b47;
border-color: #3a3a5a;
color: #fff;
}
.btn-success {
background: linear-gradient(135deg, #27ae60, #219a52);
color: #fff;
}
.btn-success:hover:not(:disabled) {
background: linear-gradient(135deg, #2ecc71, #27ae60);
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}
.btn-icon {
font-size: 15px;
}
/* Results list */
.results-section {
margin-top: 6px;
}
.results-title {
font-size: 12px;
color: #888;
text-transform: uppercase;
letter-spacing: 1px;
margin-bottom: 8px;
display: flex;
justify-content: space-between;
align-items: center;
}
.map-list {
max-height: 280px;
overflow-y: auto;
border-radius: 8px;
border: 1px solid #2a2a4a;
background: #12122a;
}
.map-list::-webkit-scrollbar {
width: 6px;
}
.map-list::-webkit-scrollbar-track {
background: transparent;
}
.map-list::-webkit-scrollbar-thumb {
background: #3a3a5a;
border-radius: 3px;
}
.map-item {
display: flex;
align-items: center;
padding: 10px 12px;
border-bottom: 1px solid #1a1a3a;
transition: background 0.15s;
gap: 10px;
}
.map-item:last-child {
border-bottom: none;
}
.map-item:hover {
background: #1a1a35;
}
.map-item .file-icon {
font-size: 18px;
flex-shrink: 0;
}
.map-item .file-info {
flex: 1;
min-width: 0;
}
.map-item .file-name {
font-size: 12px;
font-weight: 500;
color: #ddd;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.map-item .file-meta {
font-size: 10px;
color: #777;
margin-top: 2px;
}
.map-item .file-meta .tag {
display: inline-block;
padding: 1px 6px;
border-radius: 3px;
font-size: 9px;
margin-left: 8px;
}
.tag.success { background: #1a3a2a; color: #27ae60; }
.tag.fail { background: #3a1a1a; color: #e74c3c; }
.tag.info { background: #1a2a3a; color: #3498db; }
/* Progress bar */
.progress-container {
margin-top: 12px;
display: none;
}
.progress-bar {
height: 6px;
background: #16213e;
border-radius: 3px;
overflow: hidden;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg, #e94560, #f39c12);
border-radius: 3px;
transition: width 0.3s ease;
width: 0%;
}
.progress-text {
font-size: 11px;
color: #888;
margin-top: 6px;
text-align: center;
}
/* Stats */
.stats-row {
display: flex;
gap: 6px;
margin-top: 10px;
flex-wrap: wrap;
}
.stat-chip {
padding: 4px 10px;
background: #16213e;
border-radius: 12px;
font-size: 11px;
color: #aaa;
border: 1px solid #2a2a4a;
white-space: nowrap;
}
.stat-chip strong {
color: #e94560;
}
/* Empty state */
.empty-state {
text-align: center;
padding: 40px 20px;
color: #666;
}
.empty-state .icon {
font-size: 40px;
margin-bottom: 12px;
}
.empty-state p {
font-size: 13px;
margin-bottom: 4px;
}
.empty-state .hint {
font-size: 11px;
color: #555;
}
/* Footer */
.footer {
padding: 8px 20px;
border-top: 1px solid #2a2a4a;
font-size: 10px;
color: #555;
text-align: center;
}
</style>
</head>
<body>
<div class="header">
<h1>🔍 SourceMap Extractor</h1>
<div class="subtitle">检测 .map 泄露 · 一键还原前端源码</div>
</div>
<div class="content">
<!-- 状态栏 -->
<div class="status-bar" id="statusBar">
<div class="badge">
<span class="dot gray" id="statusDot"></span>
<span id="statusText">等待扫描</span>
</div>
<span style="font-size:11px;color:#666" id="urlPreview"></span>
</div>
<!-- 操作按钮 -->
<div class="btn-group">
<button class="btn btn-primary" id="btnScan">
<span class="btn-icon">🔎</span> 扫描页面
</button>
<button class="btn btn-secondary" id="btnDownloadMaps" disabled>
<span class="btn-icon">📥</span> 仅下载 .map
</button>
</div>
<div class="btn-group">
<button class="btn btn-success" id="btnDownloadAll" disabled>
<span class="btn-icon">📦</span> 下载所有源码 (.zip)
</button>
</div>
<!-- 进度条 -->
<div class="progress-container" id="progressContainer">
<div class="progress-bar">
<div class="progress-fill" id="progressFill"></div>
</div>
<div class="progress-text" id="progressText"></div>
</div>
<!-- 结果列表 -->
<div class="results-section" id="resultsSection" style="display:none">
<div class="results-title">
<span>📋 发现的 .map 文件</span>
<span id="resultCount" style="color:#e94560"></span>
</div>
<div class="map-list" id="mapList"></div>
<!-- 统计 -->
<div class="stats-row" id="statsRow"></div>
</div>
<!-- 空状态 -->
<div class="empty-state" id="emptyState">
<div class="icon">🗺️</div>
<p>点击「扫描页面」检测 Source Map 泄露</p>
<p class="hint">自动查找 JS 文件中的 sourceMappingURL 引用</p>
</div>
</div>
<div class="footer">
SourceMap Extractor v1.0 · 仅在本地处理数据
</div>
<script src="popup.js"></script>
</body>
</html>