Skip to content

Latest commit

 

History

History
9 lines (8 loc) · 1.19 KB

insta_gettoken-js.md

File metadata and controls

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

how to add bookmarklet in chrome
export default { icon: "https://www.instagram.com/favicon.ico", name: { en: "Get insta token", vi: "Get insta token", }, description: { en: "Get instagram access token", vi: "Get instagram access token", }, onClick: function() { try { const encoded = document.cookie .split("; ") ?. find((_) => _.startsWith("fbsr")) ?. split(".") [1]; if (encoded) { const decoded = JSON.parse(atob(encoded)); console.log(decoded); prompt("Access token: ", decoded.oauth_token); } else { alert( "Access token information not found in cookie!\nAre you logged into instagram??" ); } } catch (e) { alert("Error: " + e.toString()); } }, }; function backup() { // https://greasyfork.org/en/scripts/14755-instagram-reloaded function get_csrf_token() { return document.body.innerHTML .match(/\"csrf_token\":(?:"[^"]*"|^[^"]*$)/)[0] .replace(/\" /g, "") .split(":")[1] ; } }