..
This commit is contained in:
@@ -55,6 +55,36 @@ port.onMessage.addListener(response => {
|
||||
var type= response["type"];
|
||||
|
||||
switch (type) {
|
||||
case "CLICK_PREV_CHAPTER" : {
|
||||
const links = document.querySelectorAll("a");
|
||||
let found = false;
|
||||
for (let link of links) {
|
||||
if (link.textContent.includes("이전화 보기")) {
|
||||
link.click();
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
port.postMessage({ type: "MSG", msg: "이전화 버튼을 찾을 수 없습니다." });
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "CLICK_NEXT_CHAPTER" : {
|
||||
const links = document.querySelectorAll("a");
|
||||
let found = false;
|
||||
for (let link of links) {
|
||||
if (link.textContent.includes("다음화 보기")) {
|
||||
link.click();
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
port.postMessage({ type: "MSG", msg: "다음화 버튼을 찾을 수 없습니다." });
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "fetchAllImages": {
|
||||
const targetSrc = response["targetSrc"];
|
||||
const imageUrls = findAllRelatedImages(targetSrc);
|
||||
|
||||
Reference in New Issue
Block a user