Skip to content

Instantly share code, notes, and snippets.

async function fetchMarketJSON(forceFetch = false) {
let sendReq = (typeof GM.xmlHttpRequest === 'function')? GM.xmlHttpRequest : GM_xmlhttpRequest;
if (typeof sendReq !== 'function') {
console.error("fetchMarketJSON GM.xmlHttpRequest null function");
isUsingLocalMarketJson = true;
const jsonStr = MARKET_JSON_LOCAL_BACKUP;
const jsonObj = JSON.parse(jsonStr);
if (jsonObj && jsonObj.time && jsonObj.market) {
jsonObj.market.Coin.ask = 1;