Created
November 1, 2023 23:58
-
-
Save Sharlottes/d6c0e0e8055902d10f44c5986e372227 to your computer and use it in GitHub Desktop.
everytime minor community auto collector chrome extesion
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 saveLocalStorage() { | |
const newPlaces = Object.fromEntries( | |
Array.from(document.getElementsByClassName("result")).map((elem) => [ | |
elem.getAttribute("href"), | |
Array.from(elem.children).map((e) => e.innerText), | |
]) | |
); | |
const places = JSON.parse(localStorage.getItem("places") ?? "{}"); | |
Object.assign(places, newPlaces); | |
localStorage.setItem("places", JSON.stringify(places)); | |
} | |
function goNext() { | |
saveLocalStorage(); | |
const codeIdx = Number(localStorage.getItem("codeIdx") ?? "-1"); | |
localStorage.setItem("codeIdx", codeIdx + 1); | |
if (objects[codeIdx + 1]) window.location.search = `?keyword=${objects[codeIdx + 1]}`; | |
} | |
setTimeout(() => { | |
console.log(`${localStorage.getItem("codeIdx")}th loaded`); | |
goNext(); | |
}, 300 + Math.random() * 100); |
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
{ | |
"manifest_version": 3, | |
"name": "Everytime Extensions", | |
"description": "the everytime extensions", | |
"version": "0.1.0", | |
"content_scripts": [ | |
{ | |
"js": ["src/content.js"], | |
"matches": ["https://everytime.kr/community/*"] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment