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

Function getYourUserId

scripts/fb_GLOBAL.js:11–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9 return `https://graph.facebook.com/${uid}/picture?height=${size}&access_token=6628568379%7Cc1e620fa708a1d5696fb991c1bde5662`;
10}
11export async function getYourUserId() {
12 let methods = [
13 () => require("CurrentUserInitialData").USER_ID,
14 () => require("RelayAPIConfigDefaults").actorID,
15 () => document.cookie.match(/c_user=(\d+)/)[1],
16 async () =>
17 (
18 await chrome.cookies.get({
19 url: "https://www.facebook.com",
20 name: "c_user",
21 })
22 ).value,
23 ];
24 for (let m of methods) {
25 try {
26 let d = await m();
27 if (d) return d;
28 } catch (e) {}
29 }
30 return null;
31}
32export async function getUserInfoFromUid(uid) {
33 const variables = {
34 userID: uid,

Callers 3

loadModalFunction · 0.85

Calls 2

getMethod · 0.80
mFunction · 0.50

Tested by

no test coverage detected