Created
August 11, 2023 18:39
-
-
Save vernetto/06bdc05fae73efe99c953c6a990d08a6 to your computer and use it in GitHub Desktop.
functional
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getWindowIdList() { | |
const token = "pluto="; | |
const cookieValue = document.cookie.split(';') | |
.map(c => c.trimStart()) | |
.find(c => c.startsWith(token)); | |
if (cookieValue) { | |
const jsonString = cookieValue.substring(token.length); | |
try { | |
return JSON.parse(decodeURIComponent(jsonString)); | |
} catch (e) { | |
console.error("Error parsing the cookie value:", e); | |
} | |
} | |
return []; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment