Skip to content

Latest commit

 

History

History
9 lines (8 loc) · 1.99 KB

fb_gettokenffb-js.md

File metadata and controls

9 lines (8 loc) · 1.99 KB
title date categories
Fb_getTokenFfb.Js
2023-11-23
useful-script-en

how to add bookmarklet in chrome
import { getCookie, showLoading } from "./helpers/utils.js"; export default { icon: "https://ffb.vn/assets/img/illustrations/favicon.png", name: { en: "Get fb token from cookie (ffb.vn)", vi: "Get fb token from cookie (ffb.vn)", }, description: { en: "Post your facebook cookie to ffb.vn API", vi: "Send facebook cookie to ffb.vn API", }, onClickExtension: async function() { const { closeLoading, setLoadingText } = showLoading("Taking cookies..."); let cookie = await getCookie("facebook.com"); if (!cookie) { alert("No cookie found. Make sure you're logged into facebook!"); } else { / /prettier-ignore let types = ["eaaq","eaag","eaab","eaas","eaai","eaaa","open page ffb.vn",]; let typeIndex = prompt( "[Note]\n" + "+ Will send your facebook cookie to ffb.vn\n" + "+ I do not guarantee the security of your cookies\n" + "+ Click Cancel now if you want to cancel\n\n" + "Select the type of token you want to get:\n " + types.map((_, i) => ' ${i}: ${_.toUpperCase()}').join("\n"), 0 ); if (typeIndex == null) { / / cancel } else if (typeIndex < 0 || typeIndex >= types.length) { alert( "Invalid type. Please try again\nInvalid selection. Please try again" ); } else if(typeIndex == types.length – 1) { window.open("https://ffb.vn/get-token"); } else { const formData = new FormData(); formData.append("cookie", cookie); formData.append("type", types[typeIndex]); setLoadingText("Getting accesstoken from ffb.vn ..."); let res = await fetch("https://ffb.vn/api/tool/cookie2token", { method: "POST", body: formData, }); let json = await res.json(); if (json.error) { alert("ERROR: " + json.msg); } else { prompt("Access token", json.token); } } } closeLoading(); }, };