@leeguoo/pwtk-network-debugger 1.2.25 → 1.2.27
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/dist/index.cjs.js +3 -3
- package/dist/index.esm.js +69 -17
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -7414,10 +7414,10 @@ const styles = `
|
|
|
7414
7414
|
}
|
|
7415
7415
|
|
|
7416
7416
|
#network-debugger-panel.minimized {
|
|
7417
|
-
height:
|
|
7417
|
+
height: 35px !important;
|
|
7418
7418
|
overflow: hidden;
|
|
7419
|
-
width:
|
|
7420
|
-
max-width:
|
|
7419
|
+
width: 160px !important;
|
|
7420
|
+
max-width: 160px !important;
|
|
7421
7421
|
}
|
|
7422
7422
|
|
|
7423
7423
|
#network-debugger-panel.minimized .debugger-content {
|
|
@@ -7506,6 +7506,12 @@ const styles = `
|
|
|
7506
7506
|
color: #000;
|
|
7507
7507
|
}
|
|
7508
7508
|
|
|
7509
|
+
.debugger-icon {
|
|
7510
|
+
width: 16px;
|
|
7511
|
+
height: 16px;
|
|
7512
|
+
vertical-align: middle;
|
|
7513
|
+
}
|
|
7514
|
+
|
|
7509
7515
|
.debugger-content {
|
|
7510
7516
|
height: calc(100% - 40px);
|
|
7511
7517
|
overflow: hidden;
|
|
@@ -7865,9 +7871,9 @@ const styles = `
|
|
|
7865
7871
|
|
|
7866
7872
|
/* 最小化时不应用全宽,保持小尺寸 */
|
|
7867
7873
|
#network-debugger-panel.minimized {
|
|
7868
|
-
width:
|
|
7869
|
-
max-width:
|
|
7870
|
-
height:
|
|
7874
|
+
width: 160px !important;
|
|
7875
|
+
max-width: 160px !important;
|
|
7876
|
+
height: 35px !important;
|
|
7871
7877
|
}
|
|
7872
7878
|
}
|
|
7873
7879
|
|
|
@@ -7957,6 +7963,24 @@ const styles = `
|
|
|
7957
7963
|
height: 12px;
|
|
7958
7964
|
cursor: sw-resize;
|
|
7959
7965
|
}
|
|
7966
|
+
|
|
7967
|
+
.debugger-reopen-btn {
|
|
7968
|
+
position: fixed;
|
|
7969
|
+
z-index: 999999;
|
|
7970
|
+
background: #4CAF50;
|
|
7971
|
+
color: #000;
|
|
7972
|
+
border: none;
|
|
7973
|
+
padding: 8px 10px;
|
|
7974
|
+
border-radius: 16px;
|
|
7975
|
+
font-weight: bold;
|
|
7976
|
+
font-size: 12px;
|
|
7977
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.25);
|
|
7978
|
+
cursor: pointer;
|
|
7979
|
+
}
|
|
7980
|
+
|
|
7981
|
+
.debugger-reopen-btn:hover {
|
|
7982
|
+
filter: brightness(0.95);
|
|
7983
|
+
}
|
|
7960
7984
|
`;
|
|
7961
7985
|
async function createShareLink(requestData) {
|
|
7962
7986
|
try {
|
|
@@ -7983,7 +8007,7 @@ async function createShareLink(requestData) {
|
|
|
7983
8007
|
decryptedResponse: requestData.decryptedResponse,
|
|
7984
8008
|
error: requestData.error,
|
|
7985
8009
|
creator: "PWTK Network Debugger by Leo (@leeguoo)",
|
|
7986
|
-
version: "1.2.
|
|
8010
|
+
version: "1.2.26"
|
|
7987
8011
|
}
|
|
7988
8012
|
};
|
|
7989
8013
|
const originalFetch = window.__originalFetch || window.fetch;
|
|
@@ -8104,11 +8128,11 @@ const _DebugPanel = class _DebugPanel {
|
|
|
8104
8128
|
<div class="debugger-header">
|
|
8105
8129
|
<div class="debugger-title">🔓 ${this.config.minimized ? "PWTK" : "PWTK 解密小工具"} <span style="font-size: 10px; opacity: 0.7;">by Leo</span></div>
|
|
8106
8130
|
<div class="debugger-controls">
|
|
8107
|
-
${!this.config.minimized ? '<button class="debugger-btn" data-action="clear" title="清空"
|
|
8108
|
-
${!this.config.minimized ? '<button class="debugger-btn" data-action="export" title="导出"
|
|
8109
|
-
<button class="debugger-btn" data-action="minimize" title="${this.config.minimized ? "展开" : "最小化"}"
|
|
8110
|
-
${!this.config.minimized ? '<button class="debugger-btn" data-action="fullscreen" title="全屏"
|
|
8111
|
-
<button class="debugger-btn" data-action="close" title="关闭"
|
|
8131
|
+
${!this.config.minimized ? '<button class="debugger-btn" data-action="clear" title="清空"><svg class="debugger-icon" viewBox="0 0 24 24"><path fill="currentColor" d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg></button>' : ""}
|
|
8132
|
+
${!this.config.minimized ? '<button class="debugger-btn" data-action="export" title="导出"><svg class="debugger-icon" viewBox="0 0 24 24"><path fill="currentColor" d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/></svg></button>' : ""}
|
|
8133
|
+
<button class="debugger-btn" data-action="minimize" title="${this.config.minimized ? "展开" : "最小化"}"><svg class="debugger-icon" viewBox="0 0 24 24"><path fill="currentColor" d="${this.config.minimized ? "M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z" : "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}"/></svg></button>
|
|
8134
|
+
${!this.config.minimized ? '<button class="debugger-btn" data-action="fullscreen" title="全屏"><svg class="debugger-icon" viewBox="0 0 24 24"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg></button>' : ""}
|
|
8135
|
+
<button class="debugger-btn" data-action="close" title="关闭"><svg class="debugger-icon" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg></button>
|
|
8112
8136
|
</div>
|
|
8113
8137
|
</div>
|
|
8114
8138
|
<div class="debugger-content">
|
|
@@ -8489,11 +8513,11 @@ Created by Leo (@leeguoo)`);
|
|
|
8489
8513
|
header.innerHTML = `
|
|
8490
8514
|
<div class="debugger-title">🔓 ${this.config.minimized ? "PWTK" : "PWTK 解密小工具"} <span style="font-size: 10px; opacity: 0.7;">by Leo</span></div>
|
|
8491
8515
|
<div class="debugger-controls">
|
|
8492
|
-
${!this.config.minimized ? '<button class="debugger-btn" data-action="clear" title="清空"
|
|
8493
|
-
${!this.config.minimized ? '<button class="debugger-btn" data-action="export" title="导出"
|
|
8494
|
-
<button class="debugger-btn" data-action="minimize" title="${this.config.minimized ? "展开" : "最小化"}"
|
|
8495
|
-
${!this.config.minimized ? '<button class="debugger-btn" data-action="fullscreen" title="全屏"
|
|
8496
|
-
<button class="debugger-btn" data-action="close" title="关闭"
|
|
8516
|
+
${!this.config.minimized ? '<button class="debugger-btn" data-action="clear" title="清空"><svg class="debugger-icon" viewBox="0 0 24 24"><path fill="currentColor" d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg></button>' : ""}
|
|
8517
|
+
${!this.config.minimized ? '<button class="debugger-btn" data-action="export" title="导出"><svg class="debugger-icon" viewBox="0 0 24 24"><path fill="currentColor" d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/></svg></button>' : ""}
|
|
8518
|
+
<button class="debugger-btn" data-action="minimize" title="${this.config.minimized ? "展开" : "最小化"}"><svg class="debugger-icon" viewBox="0 0 24 24"><path fill="currentColor" d="${this.config.minimized ? "M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z" : "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}"/></svg></button>
|
|
8519
|
+
${!this.config.minimized ? '<button class="debugger-btn" data-action="fullscreen" title="全屏"><svg class="debugger-icon" viewBox="0 0 24 24"><path fill="currentColor" d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg></button>' : ""}
|
|
8520
|
+
<button class="debugger-btn" data-action="close" title="关闭"><svg class="debugger-icon" viewBox="0 0 24 24"><path fill="currentColor" d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg></button>
|
|
8497
8521
|
</div>
|
|
8498
8522
|
`;
|
|
8499
8523
|
const controls = header.querySelector(".debugger-controls");
|
|
@@ -8703,14 +8727,42 @@ Created by Leo (@leeguoo)`);
|
|
|
8703
8727
|
}
|
|
8704
8728
|
show() {
|
|
8705
8729
|
this.container.style.display = "block";
|
|
8730
|
+
this.removeReopenButton();
|
|
8706
8731
|
}
|
|
8707
8732
|
hide() {
|
|
8708
8733
|
this.container.style.display = "none";
|
|
8734
|
+
this.createReopenButton();
|
|
8735
|
+
}
|
|
8736
|
+
createReopenButton() {
|
|
8737
|
+
if (document.getElementById("network-debugger-reopen-btn")) return;
|
|
8738
|
+
const btn = document.createElement("button");
|
|
8739
|
+
btn.id = "network-debugger-reopen-btn";
|
|
8740
|
+
btn.className = "debugger-reopen-btn";
|
|
8741
|
+
btn.title = "打开调试面板";
|
|
8742
|
+
btn.textContent = "PWTK";
|
|
8743
|
+
const pos = this.config.position || "bottom-right";
|
|
8744
|
+
if (pos.includes("bottom")) {
|
|
8745
|
+
btn.style.bottom = "20px";
|
|
8746
|
+
} else {
|
|
8747
|
+
btn.style.top = "20px";
|
|
8748
|
+
}
|
|
8749
|
+
if (pos.includes("right")) {
|
|
8750
|
+
btn.style.right = "20px";
|
|
8751
|
+
} else {
|
|
8752
|
+
btn.style.left = "20px";
|
|
8753
|
+
}
|
|
8754
|
+
btn.addEventListener("click", () => this.show());
|
|
8755
|
+
document.body.appendChild(btn);
|
|
8756
|
+
}
|
|
8757
|
+
removeReopenButton() {
|
|
8758
|
+
const btn = document.getElementById("network-debugger-reopen-btn");
|
|
8759
|
+
if (btn) btn.remove();
|
|
8709
8760
|
}
|
|
8710
8761
|
destroy() {
|
|
8711
8762
|
this.container.remove();
|
|
8712
8763
|
const styles2 = document.getElementById("network-debugger-styles");
|
|
8713
8764
|
if (styles2) styles2.remove();
|
|
8765
|
+
this.removeReopenButton();
|
|
8714
8766
|
}
|
|
8715
8767
|
// ========== localStorage 方法 ==========
|
|
8716
8768
|
/**
|