Enhance debugging features: add debug group logging and update popup UI for clarity
This commit is contained in:
parent
0ac7326ceb
commit
e768a0bbbc
26
content.js
26
content.js
@ -28,6 +28,16 @@ function debugLog(...args) {
|
||||
console.log("[MemberFilter]", ...args);
|
||||
}
|
||||
|
||||
function debugGroup(...args) {
|
||||
if (!debugEnabled) return;
|
||||
console.group("[MemberFilter]", ...args);
|
||||
}
|
||||
|
||||
function debugGroupEnd() {
|
||||
if (!debugEnabled) return;
|
||||
console.groupEnd();
|
||||
}
|
||||
|
||||
function normalizeKey(value) {
|
||||
return value
|
||||
.toLowerCase()
|
||||
@ -110,15 +120,13 @@ function process(root = document) {
|
||||
|
||||
const whitelisted = whitelist.includes(channelKey);
|
||||
|
||||
if (debugEnabled) {
|
||||
console.group("[MemberFilter]");
|
||||
console.log("Title :", title);
|
||||
console.log("Channel:", channel);
|
||||
console.log("URL :", url);
|
||||
console.log("ID :", id || "(no id)");
|
||||
console.log("Whitelisted:", whitelisted);
|
||||
console.groupEnd();
|
||||
}
|
||||
debugGroup();
|
||||
debugLog("Title :", title);
|
||||
debugLog("Channel:", channel);
|
||||
debugLog("URL :", url);
|
||||
debugLog("ID :", id || "(no id)");
|
||||
debugLog("Whitelisted:", whitelisted);
|
||||
debugGroupEnd();
|
||||
|
||||
if (!whitelisted) {
|
||||
video.setAttribute(`data-${DATA_PREFIX}-hidden`, "true");
|
||||
|
||||
11
popup.css
11
popup.css
@ -14,6 +14,17 @@ h3 {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.subtext {
|
||||
margin: 0 0 10px;
|
||||
font-size: 11px;
|
||||
line-height: 1.3;
|
||||
color: #5b4a33;
|
||||
}
|
||||
|
||||
.subtext.subtext-debug {
|
||||
margin: 6px 0 8px;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
|
||||
@ -7,6 +7,10 @@
|
||||
</head>
|
||||
<body>
|
||||
<h3>Channel Whitelist</h3>
|
||||
<p class="subtext">
|
||||
Hide member-only videos by default. Whitelisted creators stay visible.
|
||||
Add the channel name and its @handle or link.
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<input id="channelInput" placeholder="Channel name" />
|
||||
@ -19,10 +23,13 @@
|
||||
<div class="row settings">
|
||||
<label class="toggle">
|
||||
<input id="debugToggle" type="checkbox" />
|
||||
<span>Debug</span>
|
||||
<span>Debug logging</span>
|
||||
</label>
|
||||
<button id="resetBtn" class="ghost">Reset defaults</button>
|
||||
</div>
|
||||
<p class="subtext subtext-debug">
|
||||
Debug logs will appear in the console only when enabled.
|
||||
</p>
|
||||
|
||||
<ul id="channelList"></ul>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user