const getCookies = async (url) => { await new Promise((resolve, reject) => { chrome.cookies.getAll({ url: url }, (cookies) => { if (chrome.runtime.lastError) { return reject(chrome.runtime.lastError) } resolve(cookies) }) }) } const sendMimicedRequest = async ( url, headers, ) => { let returnValue if (url) { returnValue = fetch(url, headers) } if (returnValue) { return returnValue } }