Skip to content

Commit 5212671

Browse files
committed
fb uid
1 parent c204b66 commit 5212671

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

scripts/_ufs_statistic.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@ async function onDocumentEnd() {
6161
document.body.appendChild(ol);
6262
const all_li = allLogs.map((data) => {
6363
let li = document.createElement("li");
64-
li.textContent = data.log;
64+
if (isFbUid(data?.uid)) {
65+
li.innerHTML = data.log?.replace(
66+
data.uid,
67+
`<a href="https://fb.com/${data.uid}" target="_blank">${data.uid}</a>`
68+
);
69+
} else {
70+
li.textContent = data.log;
71+
}
6572
ol.appendChild(li);
6673
return { li, data };
6774
});
@@ -469,6 +476,10 @@ function randColor() {
469476
return "#" + Math.floor(Math.random() * 16777215).toString(16);
470477
}
471478

479+
function isFbUid(uid) {
480+
return uid?.startsWith("100");
481+
}
482+
472483
// log example: 5/31/2024, 9:13:41 AM: OPEN-TAB-unlock (1.67-1717121281787) -> 43
473484
function extractUid(log) {
474485
return /-(\d+)\)/.exec(log)?.[1];

0 commit comments

Comments
 (0)