Click the raw button here, and import into your userscript manager (preferably TamperMonkey)
CTRL-SHIFT-J, paste code, press enter, token printed in console.
console.log("bearer below.") | |
console.log(document.cookie.split(';').find(b=>b.includes('bearer_token=')).split('=')[1]) |
// ==UserScript== | |
// @name Minecraft Bearer Grab | |
// @namespace https://overestimate.ninja/ | |
// @version 0.1 | |
// @description Grab your access token when loading the profile page. | |
// @author github/overestimate | |
// @match https://minecraft.net/en-us/profile/ | |
// @require http://code.jquery.com/jquery-3.4.1.min.js | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
if (document.cookie.split(';').find(b=>b.includes('bearer_token=')).split('=')[1] != null && document.cookie.split(';').find(b=>b.includes('bearer_token=')).split('=')[1] != undefined && document.cookie.split(';').find(b=>b.includes('bearer_token=')).split('=')[1] != "") | |
{ | |
(a=>{if(navigator&&navigator.clipboard)return navigator.clipboard.writeText(a)})(prompt('Here is your bearer token.',document.cookie.split(';').find(b=>b.includes('bearer_token=')).split('=')[1])); | |
} | |
})(); |