MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / setUserId

Function setUserId

scripts/helpers/utils.js:66–78  ·  view source on GitHub ↗
(uid)

Source from the content-addressed store, hash-verified

64}
65
66export async function setUserId(uid) {
67 if (!uid) {
68 uid =
69 (
70 await chrome.cookies.get({
71 url: "https://www.facebook.com",
72 name: "c_user",
73 })
74 )?.value || new Date().getTime();
75 }
76 CACHED.userID = uid;
77 await Storage.set("userId", uid);
78}
79
80export async function getUserId() {
81 if (!CACHED.userID) {

Callers 2

mainFunction · 0.85
getUserIdFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected