This commit is contained in:
2025-08-13 17:02:15 +09:00
parent 012fcd7b9b
commit 8f3dc93ec1
15 changed files with 1089 additions and 617 deletions
@@ -5,6 +5,27 @@ port.onMessage.addListener(response => {
var type= response["type"];
switch (type) {
case "search" : {
var keyword = response["keyword"];
if (location.href.search("bigkinds.or.kr") > -1) {
document.querySelector('input[id^="total-search-key"]').value = keyword
} else if (location.href.search("www.google") > -1) {
document.querySelector('form[action^="/search"]').querySelector("textarea").value = keyword
} else if(location.href.search("naver.com") > -1) {
document.querySelector('input[id^="query"]').value = keyword
} else if(location.href.search("namu.wiki") > -1) {
document.querySelector('input[type^="search"]').value = keyword
}
}
case "searchDo" : {
if (location.href.search("bigkinds.or.kr") > -1) {
document.querySelector('a[class^="bk_keywordSearchBtn"]').click()
} else if (location.href.search("www.google") > -1) {
document.querySelector('form[action^="/search"]').submit()
} else if(location.href.search("naver.com") > -1) {
document.querySelector('[class^="sch_btn_search"]').click()
}
}
case "getList": {
try {
// var listBody = null
@@ -39,6 +60,7 @@ port.onMessage.addListener(response => {
}break;
case "scrollDown":{
autoScrollAndSave()
var max = response["max"]
var current = response["current"]
var isUpDown = response["isUpDown"]
@@ -74,7 +96,7 @@ port.onMessage.addListener(response => {
}
break;
case "saveContent":{
scrollToLazyImg()
scrollToLazyImg(true === response["fast"])
}
default:
port.postMessage(`Received: ${JSON.stringify(response)}`);
@@ -235,12 +257,12 @@ document.addEventListener('DOMContentLoaded', function () {
})
function scrollToLazyImg() {
function scrollToLazyImg(fastMode) {
(function(autoScrollAndSave){
// 한 번에 이동할 픽셀
const step = 200;
const step = fastMode ? 600 : 200;
// 반복 간격(ms) (느릴수록 로딩에 더 여유 생김)
const delay = 600;
const delay = fastMode ? 200 : 600;
// 스크롤 현재 위치 추적
let currentY = window.scrollY;
let maxY = Math.max(
@@ -322,357 +344,62 @@ function isNewerThanOneDay(dateStr) {
return (now - date) < oneDayMs;
}
function autoScrollAndSave(senContents) {
if (location.href.search("nate.com") > -1 && document.querySelectorAll("#ad_sponsorBar")) {
if (location.href.startsWith("https://news.nate.com")) {
var string = location.href.toString()
string = string.replace("https://","https://m.");
location.href = string
}
document.querySelectorAll('[class^="float-adv-wrap"]').forEach(e => e.remove())
document.querySelectorAll('[id^="ad_"]').forEach(e => e.remove())
document.querySelectorAll("#ad_sponsorBar").forEach((element) => {element.remove();});
document.querySelectorAll("#newsSidebar").forEach((element) => {element.remove();});
document.querySelectorAll("#header").forEach((element) => {element.remove();});
document.querySelectorAll('iframe[id^="ad"]').forEach(e => e.remove())
document.querySelectorAll("#module_ssul").forEach((element) => {element.remove();});
document.querySelectorAll('[class^="boxtype1 thisTimeNews"]').forEach(e => e.remove())
document.querySelectorAll("#mediaFooter").forEach((element) => {element.remove();});
document.querySelectorAll('[class^="news_cmt"]').forEach(e => e.remove())
document.querySelectorAll('section[class^="rwd_right"]').forEach(e => e.remove())
// 도메인에 맞는 handler 실행
const matchedRule = domainRules.find(rule => rule.test(location.href));
if (matchedRule) {
matchedRule.handler();
}
// 공통 광고 요소 제거는 항상 실행
handleCommon();
window.scrollTo({ top: 2, behavior: 'smooth' });
if (mainContentsEl == null) {
mainContentsEl = document.body.outerHTML
}
if (senContents) {
sendMessage({type: "MainContentsEl", contents: mainContentsEl.outerHTML, currentPage: location.href});
}
}
}
// 도메인 규칙 배열
const domainRules = [
{ test: url => url.includes("nate.com") && document.querySelectorAll("#ad_sponsorBar").length > 0, handler: handleNate },
{ test: url => url.includes("zdnet.co.kr"), handler: handleZdnet },
{ test: url => url.includes("inews24"), handler: handleInews24 },
{ test: url => url.includes("starnewskorea"), handler: handleStarnewsKorea },
{ test: url => url.includes("khan.co.kr"), handler: handleKhan },
{ test: url => url.includes("m.health.chosun.com"), handler: handleHealthChosun },
{ test: url => url.includes("betanews"), handler: handleBetanews },
{ test: url => url.includes("newsis.com"), handler: handleNewsis },
{ test: url => url.includes("seoul.co.kr"), handler: handleSeoul },
{ test: url => url.includes("ytn.co.kr"), handler: handleYtn },
{ test: url => url.includes("nocutnews.co.kr"), handler: handleNocutnews },
{ test: url => url.includes("sedaily.com"), handler: handleSedaily },
{ test: url => url.includes("digitaltoday"), handler: handleDigitaltoday },
{ test: url => url.includes("kormedi"), handler: handleKormedi },
{ test: url => url.includes("chosun.com"), handler: handleChosun },
{ test: url => url.includes("traveltimes"), handler: handleTraveltimes },
{ test: url => url.includes("theqoo.net") && document.querySelectorAll('[class^="m-list m-element"]').length > 0, handler: handleTheqoo },
{ test: url => url.includes("doctorsnews"), handler: handleDoctorsnews },
{ test: url => url.includes("dcinside.com") && document.querySelectorAll('[class^="container"]').length > 0, handler: handleDcinside },
{ test: url => url.includes("fmkorea.com") && document.querySelectorAll('[class^="bd bd_mobile"]').length > 0, handler: handleFmkorea },
{ test: url => url.includes("torrentzota"), handler: handleToreentZota},
{ test: url => url.includes("acrofan.com") && document.querySelectorAll('[id^="wide"]').length > 0, handler: handleAcrofan },
{ test: url => url.includes("yna.co.kr") && document.querySelectorAll('[class^="wrapper"]').length > 0, handler: handleYna },
{ test: url => url.includes("clien") && document.querySelectorAll('[class^="content_view"]').length > 0, handler: handleClien },
{ test: url => url.includes("toki") && (document.querySelectorAll('[id^="id_mbv"]').length > 0 || document.querySelectorAll('[class^="basic-banner"]').length > 0), handler: handleToki },
];
if (location.href.search("khan.co.kr") > -1) {
document.querySelectorAll('[class^="banner-"]').forEach(e => e.remove())
document.querySelectorAll('[class^="google-auto-placed"]').forEach(e => e.remove())
document.querySelectorAll('[class^="relationList"]').forEach(e => e.remove())
document.querySelectorAll('[class^="reporter_news"]').forEach(e => e.remove())
document.querySelectorAll('[class^="box"]').forEach(e => e.remove())
document.querySelectorAll('footer').forEach(e => e.remove())
document.querySelectorAll('iframe').forEach(e => e.remove())
document.querySelectorAll('[class^="bottom-wrap"]').forEach(e => e.remove())
document.querySelectorAll('aside[class^="list-wrap"]').forEach(e => e.remove())
document.querySelectorAll('div[style^="width:100%;height:250px;text-align:center;margin-bottom:20px;overflow:hidden;"]').forEach(e => e.remove())
function handleCommon() {
// 공통 광고 제거
if (document.querySelector(".top_google_ad_space")) document.querySelector(".top_google_ad_space").remove();
document.querySelectorAll(".adv-group, [id^='div-gpt-ad'], [id^='div_adnmore_area'], [class^='adv-groupno'], [class^='code-block'], .ad-template").forEach(e => e.remove());
if (document.querySelector('#xpromo-bottom-sheet')) document.querySelector('#xpromo-bottom-sheet').remove();
}
if (location.href.search("betanews") > -1) {
document.querySelectorAll('[class^="banner"]').forEach(e => e.remove())
document.querySelectorAll('aside[class^="list-wrap"]').forEach(e => e.remove())
document.querySelectorAll('section[class^="bottom"]').forEach(e => e.remove())
document.querySelectorAll('footer').forEach(e => e.remove())
}
if (location.href.search("newsis.com") > -1) {
document.querySelectorAll('div[style^="width: 300px; margin: 0 auto 25px;"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="listStyle"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="headtopBanner"]').forEach(e => e.remove())
document.querySelectorAll('div[id^="ad_"]').forEach(e => e.remove())
document.querySelectorAll('div[id^="adbay"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="article"]').forEach(function (e) {
e.querySelectorAll("iframe").forEach(e => e.remove())
})
document.querySelectorAll('div[class^="Float"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="bxcn"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="A1"]').forEach(e => e.remove())
document.querySelectorAll('div[id^="news_body_end"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="linkNews"]').forEach(e => e.remove())
document.querySelectorAll('div[id^="footer"]').forEach(e => e.remove())
}
if (location.href.search("seoul.co.kr") > -1) {
document.querySelectorAll('div[class^="rowAd"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="ad"]').forEach(e => e.remove())
document.querySelectorAll('[class^="articleBottomNews"]').forEach(e => e.remove())
document.querySelectorAll('[class^="sub-layoutBorder"]').forEach(e => e.remove())
document.querySelectorAll('[class^="m-sectionLayout"]').forEach(e => e.remove())
document.querySelectorAll('[id^="rollingAdDiv"]').forEach(e => e.remove())
document.querySelectorAll('footer').forEach(e => e.remove())
document.querySelectorAll('[class^="banner"]').forEach(e => e.remove())
document.querySelectorAll('[class^="joinPopup"]').forEach(e => e.remove())
}
if (location.href.search("ytn.co.kr") > -1) {
document.querySelectorAll('div[class^="footer"]').forEach(e => e.remove())
document.querySelectorAll('div[style^="width: 100%; background-color: rgb(255, 255, 255); display: flex; justify-content: center;"]').forEach(e => e.remove())
document.querySelectorAll('div[style^="width:100%"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="ad_"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="bx_hot"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="bx_ad"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="bx_pro"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="bx_main"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="bx_sns"]').forEach(e => e.remove())
document.querySelectorAll('div[id^="popularArea"]').forEach(e => e.remove())
}
if (location.href.search("nocutnews.co.kr")> -1) {
document.querySelectorAll('div[style^="width:300px; margin:0 auto 25px;"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="ct2"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="footer"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="con_b"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="v_like"]').forEach(e => e.remove())
document.querySelectorAll('div[id^="divCommonRelated"]').forEach(e => e.remove())
document.querySelectorAll('iframe').forEach(e => e.remove())
}
if (location.href.search("sedaily.com") > -1) {
document.querySelectorAll('div[class^="article"]').forEach(function (e) {
e.querySelectorAll("iframe").forEach(e => e.remove())
})
document.querySelectorAll('div[class^="banner"]').forEach(e => e.remove())
document.querySelectorAll('div[class^=" banner"]').forEach(e => e.remove())
document.querySelectorAll('div[class^="col-right"]').forEach(e => e.remove())
document.querySelectorAll('footer[class^="footer"]').forEach(e => e.remove())
}
if (location.href.search("digitaltoday") > -1) {
document.querySelectorAll('[class^="aedi"]').forEach(e => e.remove())
document.querySelectorAll('[id^="layer-popups"]').forEach(e => e.remove())
document.querySelectorAll('[id^="enters"]').forEach(e => e.remove())
document.querySelectorAll('[class^="view-toast"]').forEach(e => e.remove())
document.querySelectorAll('footer[id^="user"]').forEach(e => e.remove())
document.querySelectorAll('[class^="clearfix"]').forEach(e => e.remove())
document.querySelectorAll('[id^="bottom-sticky"]').forEach(e => e.remove())
if (location.href.search("kormedi") > -1) {
document.querySelectorAll('[class^="entry-content-after"]').forEach(e => e.remove())
document.querySelectorAll('[class^="code-block"]').forEach(e => e.remove())
document.querySelectorAll('[class^="post-featured"]').forEach(e => e.remove())
document.querySelectorAll('footer[class^="cs"]').forEach(e => e.remove())
document.querySelectorAll('ins[class^="adsbygoogle"]').forEach(e => e.remove())
}
}
if (location.href.search("chosun.com") > -1) {
document.querySelectorAll('[class^="arcad-wrapper"]').forEach(e => e.remove())
document.querySelectorAll('[class^="flex-chain-wrapper"]').forEach(e => e.remove())
document.querySelectorAll('footer[class^="layout"]').forEach(e => e.remove())
document.querySelectorAll('aside[class^="layout"]').forEach(e => e.remove())
document.querySelectorAll('ins').forEach(e => e.remove())
}
if (location.href.search("traveltimes") > -1) {
document.querySelectorAll('ins').forEach(e => e.remove())
document.querySelectorAll('[class^="teads"]').forEach(e => e.remove())
document.querySelectorAll('[class^="tdn"]').forEach(e => e.remove())
document.querySelectorAll('aside[class^="grid"]').forEach(e => e.remove())
document.querySelectorAll('footer[id^="user"]').forEach(e => e.remove())
document.querySelectorAll('[class^="clearfix"]').forEach(e => e.remove())
}
if (location.href.search("theqoo.net") > -1 && document.querySelectorAll('[class^="m-list m-element"]')) {
document.querySelectorAll('[class^="m-list m-element"]').forEach(e => e.remove())
document.querySelectorAll('[class^="button_area"]').forEach(e => e.remove())
document.querySelectorAll('[class^="board_content_google_ad"]').forEach(e => e.remove())
document.querySelectorAll('[class^="clearfix list-header"]').forEach(e => e.remove())
document.querySelectorAll('[class^="clearfix list-footer"]').forEach(e => e.remove())
document.querySelectorAll('[class^="main-footer"]').forEach(e => e.remove())
document.querySelectorAll('ins[class^="adsbygoogle"]').forEach(e => e.remove())
mainContentsEl = document.querySelector('div[id="grid-content"]')
}
if(location.href.search("doctorsnews") > -1) {
document.querySelectorAll('[class^="clearfix"]').forEach(e => e.remove())
document.querySelectorAll('aside').forEach(e => e.remove())
document.querySelectorAll('[class^="banner_"]').forEach(e => e.remove())
}
if (location.href.search("dcinside.com") > -1 && document.querySelectorAll('[class^="container"]')) {
document.querySelectorAll('[id^="view_btn_area"]').forEach(e => e.remove())
document.querySelectorAll('[class^="trend-rank"]').forEach(e => e.remove())
document.querySelectorAll('[class^="view-btm-con"]').forEach(e => e.remove())
document.querySelectorAll('[class^="md-tit-box"]').forEach(e => e.remove())
document.querySelectorAll('[class^="gall-detail-lst"]').forEach(e => e.remove())
document.querySelectorAll('[class^="outside-search-box"]').forEach(e => e.remove())
document.querySelectorAll('[class^="footer ftlong"]').forEach(e => e.remove())
document.querySelectorAll('[class^="adv-group"]').forEach(e => e.remove())
document.querySelectorAll('li[style^="cursor:default;"]').forEach(e => e.remove())
mainContentsEl = document.querySelector('div[class="container"]')
}
if (location.href.search("fmkorea.com") > -1 && document.querySelectorAll('[class^="bd bd_mobile"]')) {
document.querySelectorAll('[class^="fmad_wrapper fmad_naver_power_link"]').forEach(e => e.remove())
document.querySelectorAll('[class^="ad ad_wrapper"]').forEach(e => e.remove())
document.querySelectorAll('[class^="bd_lst_wrp"]').forEach(e => e.remove())
document.querySelectorAll('[class^="m_top_hotdeal"]').forEach(e => e.remove())
document.querySelectorAll('[style^="margin-top:2px;line-height:0;"]').forEach(e => e.remove())
mainContentsEl = document.querySelector('div[class="bd bd_mobile"]')
}
if (location.hostname.search("acrofan.com") > -1 && document.querySelectorAll('[id^="wide"]')) {
document.querySelectorAll('[class^="header"]').forEach(e => e.remove())
document.querySelectorAll('[class^="footer"]').forEach(e => e.remove())
document.querySelectorAll('[id^="tabmenu"]').forEach(e => e.remove())
mainContentsEl = document.querySelector('div[class="wide"]')
}
if (location.hostname.search("yna.co.kr") > -1 && document.querySelectorAll('[class^="wrapper"]')) {
document.querySelectorAll('[class^="aside-box426 sticky"]').forEach(e => e.remove())
document.querySelectorAll('aside[class^="aside-box"]').forEach(e => e.remove())
document.querySelectorAll('[class^="section02"]').forEach(e => e.remove())
document.querySelectorAll('[class^="content03 wide"]').forEach(e => e.remove())
document.querySelectorAll('[id="footer"]').forEach(e => e.remove())
mainContentsEl = document.querySelector('div[id="container"]')
}
if (location.hostname.search("clien") > -1 && document.querySelectorAll('[class^="content_view"]')) {
document.querySelectorAll('[class^="view_top"]').forEach(e => e.remove())
document.querySelectorAll('[id^="naverAd"]').forEach(e => e.remove())
document.querySelectorAll('[class^="content_view_list"]').forEach(e => e.remove())
document.querySelectorAll('[class^="footer_wrap"]').forEach(e => e.remove())
mainContentsEl = document.querySelector('div[id="content_view"]')
}
if (location.hostname.search("toki") > -1 && document.querySelectorAll('[id^="id_mbv"]')) {
document.querySelectorAll('[id^="id_mbv"]').forEach(e => e.remove())
}
if (location.hostname.search("toki") > -1 && document.querySelectorAll('[class^="basic-banner"]')) {
document.querySelectorAll('[class^="basic-banner"]').forEach(e => e.remove())
}
if (document.querySelector(".top_google_ad_space")) {
document.querySelector(".top_google_ad_space").remove()
}
if (document.querySelectorAll(".adv-group")) {
document.querySelectorAll(".adv-group").forEach(e =>
e.remove()
)
}
if (document.querySelectorAll('[id^="div-gpt-ad"]')) {
document.querySelectorAll('[id^="div-gpt-ad"]').forEach(e =>
e.remove()
)
}
if (document.location.href.search("reddit") > -1) {
if (document.querySelector('#xpromo-bottom-sheet')) {
document.querySelector('#xpromo-bottom-sheet').remove()
}
}
if (document.querySelectorAll('[id^="div_adnmore_area"]')) {
document.querySelectorAll('[id^="div_adnmore_area"]').forEach(e =>
e.remove()
)
}
if (document.querySelectorAll('[id^="div_adnmore_area"]')) {
document.querySelectorAll('[id^="div_adnmore_area"]').forEach(e =>
e.remove()
)
}
if (document.querySelectorAll('[class^="adv-groupno"]')) {
document.querySelectorAll('[class^="adv-groupno"]').forEach(e =>
e.remove()
)
}
if (document.querySelectorAll('[class^="code-block"]')) {
document.querySelectorAll('[class^="code-block"]').forEach(e => e.remove())
}
if (document.querySelectorAll('.ad-template')) {
document.querySelectorAll('.ad-template').forEach(function (e) {
e.remove()
})
}
if (location.href.search("arca.live") > -1 && document.querySelectorAll('[class^="vrow hybrid"]')) {
const tempArray = [];
document.querySelectorAll('[class^="vrow hybrid"]').forEach(function (aracaLi) {
if (aracaLi.innerHTML.search("title ") > -1) {
// title.hybrid-title 클래스가 붙은 첫 번째 요소 텍스트 추출
let titleEl = aracaLi.querySelector('.title.hybrid-title');
let title = titleEl ? titleEl.textContent.trim() : '';
// badge 클래스 텍스트와 user-info 클래스 텍스트 합치기
let descBadge = aracaLi.querySelector('.badge');
let descUserInfo = aracaLi.querySelector('.user-info');
let desc = (descBadge ? descBadge.textContent.trim() : '')
if (desc.length > 0) {
desc = desc + ","
}
desc = desc + (descUserInfo ? descUserInfo.textContent.trim() : '');
if (descUserInfo) {
desc = desc + ","
}
// time 태그 datetime 속성 값
let timeEl = aracaLi.querySelector('time');
let dateTime = timeEl ? timeEl.getAttribute('datetime') : '';
// console.log("dateTime >>> "+ dateTime)
// const dateObj = new Date(dateTime);
// console.log(dateObj.getFullYear()); // 2025
// console.log(dateObj.getMonth() + 1); // 7 (월은 0부터 시작하므로 +1)
// console.log(dateObj.getDate()); // 30
// console.log(dateObj.getHours()); // 13 (현지 시간 기준)
// console.log(dateObj.getMinutes()); // 45
// console.log(dateObj.getSeconds());
// console.log(dateObj);
// img 태그 src 값
let imgEl = aracaLi.querySelector('img');
let thumbnail = imgEl ? imgEl.getAttribute('src') : '';
// 링크 만들기
let link = 'https://arca.live';
if (titleEl && titleEl.getAttribute('href')) {
link += titleEl.getAttribute('href');
} else {
let aEl = aracaLi.querySelector('a');
if (aEl && aEl.getAttribute('href')) {
link += aEl.getAttribute('href');
}
}
if (title.length > 0 && link.length > 20) {
// thumbnail 절대경로 처리 (프로토콜이 없는 경우 https: 붙이기)
if (thumbnail.startsWith('//')) {
thumbnail = 'https:' + thumbnail;
}
// 날짜가 하루 이내인지 확인하는 함수 사용
tempArray.push({
title: title.replace(/\s+/g, ' ').trim(),
description: desc.replace(/\s+/g, ' ').trim() + "ARCA",
pubDate: new Date(dateTime).getTime(),
originPage: link,
"category": "ARCA",
thumbnail: thumbnail
});
}
}
})
if (tempArray.length > 0) {
console.log(tempArray);
sendMessage(
{
type: "PRIVATES",
privates: tempArray,
currentPage: location.href
}
);
location.href = "about:blank;"
}
}
if (document.querySelectorAll('[class^="popupBanner_w popupOpen"]')) {
document.querySelectorAll('[class^="popupBanner_w popupOpen"]').forEach(function (e) {
e.remove()
})
}
if (document.querySelectorAll('iframe')) {
document.querySelectorAll('iframe').forEach(function (e) {
if (e.getAttribute("src") != null && (e.getAttribute("src").search("ads") > -1 || e.getAttribute("src").search("coupang") > -1)) {
e.remove()
}
})
}
if (location.href.search("x.com") > -1) {
var mainClass = document.querySelector('section').className
document.querySelector('section').querySelectorAll('div[class="' + mainClass + '"]').forEach(function (e) {
if (e.hasAttribute("data-testid") && e.querySelector('video')) {
e.querySelectorAll('[poster]').forEach(function (e) {
})
console.log(e.innerHTML)
}
})
}
document.querySelectorAll('iframe').forEach(e => {
const src = e.getAttribute("src");
if (src != null && (src.includes("ads") || src.includes("coupang"))) e.remove();
});
if (document.querySelectorAll('[data-banner^="coupang-"]')) {
document.querySelectorAll('[data-banner^="coupang-"]').forEach(e => e.remove())
@@ -690,6 +417,127 @@ function autoScrollAndSave(senContents) {
if (document.querySelectorAll('[class^="science-banner-area"]')) {
document.querySelectorAll('[class^="science-banner-area"]').forEach(e => e.remove())
}
if (document.querySelectorAll('[class^="col-md-4 mb-4 video-item"]').length > 1) {
var datas = []
document.querySelectorAll('[class^="col-md-4 mb-4 video-item"]').forEach(function (e) {
var date = 0
try {
const dateString = e.querySelector('[class^="mb-2"]').querySelector("a").textContent.trim();
const [day, month, year] = dateString.split("/").map(Number);
date = new Date(year, month - 1, day).getTime();
} catch (e) {
}
var actor = ""
try {
actor = e.querySelector('[class^="mb-1"]').getAttribute("alt").trim()
} catch (e) {
}
var desc = ""
try {
e.querySelectorAll('[class^="badge badge-"]').forEach(function (e) {
try {
if (Number(e.textContent) > 0) {
} else {
if (desc.length > 0) {
desc += ","
}
desc += e.textContent.trim()
}
} catch (e) {
}
}
)
} catch (e) {
}
var thumb = ""
try {
thumb = e.querySelector("td").querySelector("a").getAttribute('data-link')
try {
var sets = e.querySelector("td").querySelector("img").getAttribute('srcset')
if (sets.search(",") > -1) {
var srcSet = sets.split(",")
var newT = srcSet[srcSet.length - 1]
if (newT != null && newT.length > 5) {
thumb = newT
}
}
} catch (e) {
}
} catch (e) {
}
var magnet = ""
try {
e.querySelectorAll("td").forEach(function (e) {
e.querySelectorAll("a").forEach(function (e) {
if (e.getAttribute("href").startsWith("magnet")) {
magnet = e.getAttribute("href").replaceAll("&amp;", "&");
}
})
})
} catch (e) {
}
var title = "";
try {
e.querySelector(".name").querySelector("a").querySelectorAll("span").forEach(function (e) {
if (e.hasAttribute("class") == false) {
title = e.textContent.trim();
}
})
} catch (e) {
}
var originPage = ""
try {
originPage = location.protocol + "//" + location.hostname + e.querySelector(".name").querySelector("a").getAttribute("href");
} catch (e) {
}
var screenshots = ""
try {
e.querySelectorAll("a").forEach(function (e) {
if (e.getAttribute("href").search("screenshots") > -1) {
screenshots = e.getAttribute("href");
}
})
} catch (e) {
}
if (thumb.length > 0 || screenshots.length > 0) {
}
datas.push({
"title": title,
"description": desc,
"originPage": originPage,
"magnet_link": magnet,
"thumbnail": thumb,
"pubDate": date,
"screenshotsUrl": screenshots,
"chosung": "",
"category": "PRIVATE"
});
})
sendMessage(
{
type: "PRIVATES",
privates: datas,
currentPage: location.href
}
);
gotoNext()
}
window.scrollTo({ top: 2, behavior: 'smooth' });
}
function handleToreentZota() {
if (location.href.search("torrentzota") > -1 && document.querySelectorAll('a')) {
document.querySelectorAll('a').forEach(function (e) {
if (e.getAttribute('href') != null && e.getAttribute('href').startsWith("/adver-")) {
@@ -812,125 +660,122 @@ function autoScrollAndSave(senContents) {
}
}
if (document.querySelectorAll('[class^="col-md-4 mb-4 video-item"]').length > 1) {
var datas = []
document.querySelectorAll('[class^="col-md-4 mb-4 video-item"]').forEach(function (e) {
var date = 0
try {
const dateString = e.querySelector('[class^="mb-2"]').querySelector("a").textContent.trim();
const [day, month, year] = dateString.split("/").map(Number);
date = new Date(year, month - 1, day).getTime();
} catch (e) {
}
var actor = ""
try {
actor = e.querySelector('[class^="mb-1"]').getAttribute("alt").trim()
} catch (e) {
}
var desc = ""
try {
e.querySelectorAll('[class^="badge badge-"]').forEach(function (e) {
try {
if (Number(e.textContent) > 0) {
} else {
if (desc.length > 0) {
desc += ","
}
desc += e.textContent.trim()
}
} catch (e) {
}
}
)
} catch (e) {
}
var thumb = ""
try {
thumb = e.querySelector("td").querySelector("a").getAttribute('data-link')
try {
var sets = e.querySelector("td").querySelector("img").getAttribute('srcset')
if (sets.search(",") > -1) {
var srcSet = sets.split(",")
var newT = srcSet[srcSet.length - 1]
if (newT != null && newT.length > 5) {
thumb = newT
}
}
} catch (e) {
}
} catch (e) {
}
var magnet = ""
try {
e.querySelectorAll("td").forEach(function (e) {
e.querySelectorAll("a").forEach(function (e) {
if (e.getAttribute("href").startsWith("magnet")) {
magnet = e.getAttribute("href").replaceAll("&amp;", "&");
}
})
})
} catch (e) {
}
var title = "";
try {
e.querySelector(".name").querySelector("a").querySelectorAll("span").forEach(function (e) {
if (e.hasAttribute("class") == false) {
title = e.textContent.trim();
}
})
} catch (e) {
}
var originPage = ""
try {
originPage = location.protocol + "//" + location.hostname + e.querySelector(".name").querySelector("a").getAttribute("href");
} catch (e) {
}
var screenshots = ""
try {
e.querySelectorAll("a").forEach(function (e) {
if (e.getAttribute("href").search("screenshots") > -1) {
screenshots = e.getAttribute("href");
}
})
} catch (e) {
}
if (thumb.length > 0 || screenshots.length > 0) {
}
datas.push({
"title": title,
"description": desc,
"originPage": originPage,
"magnet_link": magnet,
"thumbnail": thumb,
"pubDate": date,
"screenshotsUrl": screenshots,
"chosung": "",
"category": "PRIVATE"
});
})
sendMessage(
{
type: "PRIVATES",
privates: datas,
currentPage: location.href
}
);
gotoNext()
}
window.scrollTo({ top: 2, behavior: 'smooth' });
if (senContents) {
sendMessage({type: "MainContentsEl", contents: mainContentsEl.outerHTML, currentPage: location.href});
}
// 도메인별 처리 함수 모음
function handleNate() {
if (location.href.startsWith("https://news.nate.com")) {
location.href = location.href.replace("https://", "https://m.");
}
document.querySelectorAll('[class^="float-adv-wrap"]').forEach(e => e.remove());
document.querySelectorAll('[id^="ad_"]').forEach(e => e.remove());
document.querySelectorAll("#ad_sponsorBar, #newsSidebar, #header, #module_ssul, #mediaFooter").forEach(e => e.remove());
document.querySelectorAll('iframe[id^="ad"]').forEach(e => e.remove());
document.querySelectorAll('[class^="boxtype1 thisTimeNews"], [class^="news_cmt"], section[class^="rwd_right"]').forEach(e => e.remove());
}
function handleZdnet() {
document.querySelectorAll('div[id*="FloatCon"]').forEach(e => e.remove());
}
function handleInews24() {
document.querySelectorAll('ad[alt^="a"], div[class^="topnews"], form[class^="talkplus"], form[class^="timeline"], form[class^="photo"], ins[class^="adsbygoogle"], footer[class^="footer"], ad, footer').forEach(e => e.remove());
}
function handleStarnewsKorea() {
document.querySelectorAll('div[class^="floating-top-ad"], div[class^="fixed bottom"], section[class^="mt-4"], div[id^="dablewidget_"], footer[class^="footer"]').forEach(e => e.remove());
}
function handleKhan() {
document.querySelectorAll('[class^="banner-"], [class^="google-auto-placed"], [class^="relationList"], [class^="reporter_news"], [class^="box"], footer, iframe, [class^="bottom-wrap"], aside[class^="list-wrap"], div[style^="width:100%;height:250px"]').forEach(e => e.remove());
}
function handleHealthChosun() {
document.querySelectorAll('ins, iframe, footer, div[class^="google-"], div[id^="banner-"], section[class^="hranking"], section[class^="related-articles"], div[class^="separator-container"], div[class^="raw-html"]').forEach(e => e.remove());
mainContentsEl = document.querySelectorAll('article[class^="layout_"]');
}
function handleBetanews() {
document.querySelectorAll('[class^="banner"], aside[class^="list-wrap"], section[class^="bottom"], footer').forEach(e => e.remove());
}
function handleNewsis() {
document.querySelectorAll('div[style^="width: 300px; margin: 0 auto 25px;"], div[class^="listStyle"], div[class^="headtopBanner"], div[id^="ad_"], div[id^="adbay"], div[class^="article"], div[class^="Float"], div[class^="bxcn"], div[class^="A1"], div[id^="news_body_end"], div[class^="linkNews"], div[id^="footer"]').forEach(e => e.remove());
document.querySelectorAll('div[class^="article"]').forEach(e => e.querySelectorAll("iframe").forEach(i => i.remove()));
}
function handleSeoul() {
document.querySelectorAll('div[class^="rowAd"], div[class^="ad"], [class^="articleBottomNews"], [class^="sub-layoutBorder"], [class^="m-sectionLayout"], [id^="rollingAdDiv"], footer, [class^="banner"], [class^="joinPopup"]').forEach(e => e.remove());
}
function handleYtn() {
document.querySelectorAll(
'div[class^="footer"], div[style^="width: 100%; background-color: rgb(255, 255, 255); display: flex; justify-content: center;"], div[style^="width:100%"], ' +
'div[class^="ad_"], div[class^="bx_hot"], div[class^="bx_ad"], div[class^="bx_pro"], div[class^="bx_main"], div[class^="bx_sns"], div[id^="popularArea"]'
).forEach(e => e.remove());
}
function handleNocutnews() {
document.querySelectorAll('div[style^="width:300px; margin:0 auto 25px;"], div[class^="ct2"], div[class^="footer"], div[class^="con_b"], div[class^="v_like"], div[id^="divCommonRelated"], iframe').forEach(e => e.remove());
}
function handleSedaily() {
document.querySelectorAll('div[class^="article"]').forEach(e => e.querySelectorAll("iframe").forEach(i => i.remove()));
document.querySelectorAll('div[class^="banner"], div[class^=" banner"], div[class^="col-right"], footer[class^="footer"]').forEach(e => e.remove());
}
function handleDigitaltoday() {
document.querySelectorAll('[class^="aedi"], [id^="layer-popups"], [id^="enters"], [class^="view-toast"], footer[id^="user"], [class^="clearfix"], [id^="bottom-sticky"]').forEach(e => e.remove());
}
function handleKormedi() {
document.querySelectorAll('[class^="entry-content-after"], [class^="code-block"], [class^="post-featured"], footer[class^="cs"], ins[class^="adsbygoogle"]').forEach(e => e.remove());
}
function handleChosun() {
document.querySelectorAll('[class^="arcad-wrapper"], [class^="flex-chain-wrapper"], footer[class^="layout"], aside[class^="layout"], ins, div[id^="paywallCont"], div[class^="paywall--bg"]').forEach(e => e.remove());
}
function handleTraveltimes() {
document.querySelectorAll('ins, [class^="teads"], [class^="tdn"], aside[class^="grid"], footer[id^="user"], [class^="clearfix"]').forEach(e => e.remove());
}
function handleTheqoo() {
document.querySelectorAll('[class^="m-list m-element"], [class^="button_area"], [class^="board_content_google_ad"], [class^="clearfix list-header"], [class^="clearfix list-footer"], [class^="main-footer"], ins[class^="adsbygoogle"]').forEach(e => e.remove());
mainContentsEl = document.querySelector('div[id="grid-content"]');
}
function handleDoctorsnews() {
document.querySelectorAll('[class^="clearfix"], aside, [class^="banner_"]').forEach(e => e.remove());
}
function handleDcinside() {
document.querySelectorAll(
'[id^="view_btn_area"], [class^="trend-rank"], [class^="view-btm-con"], [class^="md-tit-box"], [class^="gall-detail-lst"], [class^="outside-search-box"], [class^="footer ftlong"], [class^="adv-group"], li[style^="cursor:default;"], [id^="div_adnmore_area"]'
).forEach(e => e.remove());
document.querySelectorAll('div[class="container"]').forEach(e => e.remove()); // just in case
mainContentsEl = document.querySelector('div[class="container"]');
}
function handleFmkorea() {
document.querySelectorAll('[class^="fmad_wrapper fmad_naver_power_link"], [class^="ad ad_wrapper"], [class^="bd_lst_wrp"], [class^="m_top_hotdeal"], [style^="margin-top:2px;line-height:0;"]').forEach(e => e.remove());
mainContentsEl = document.querySelector('div[class="bd bd_mobile"]');
}
function handleAcrofan() {
document.querySelectorAll('[class^="header"], [class^="footer"], [id^="tabmenu"]').forEach(e => e.remove());
mainContentsEl = document.querySelector('div[class="wide"]');
}
function handleYna() {
document.querySelectorAll('[class^="aside-box426 sticky"], aside[class^="aside-box"], [class^="section02"], [class^="content03 wide"], [id="footer"]').forEach(e => e.remove());
mainContentsEl = document.querySelector('div[id="container"]');
}
function handleClien() {
document.querySelectorAll('[class^="view_top"], [id^="naverAd"], [class^="content_view_list"], [class^="footer_wrap"]').forEach(e => e.remove());
mainContentsEl = document.querySelector('div[id="content_view"]');
}
function handleToki() {
document.querySelectorAll('[id^="id_mbv"], [class^="basic-banner"]').forEach(e => e.remove());
}