..
This commit is contained in:
@@ -62,4 +62,14 @@
|
||||
//// // 앱으로 오류 신호 전달
|
||||
//// browser.runtime.sendMessage({ type: 'RELOAD_REQUEST' });
|
||||
//// }
|
||||
////});
|
||||
////});
|
||||
|
||||
browser.webRequest.onBeforeRequest.addListener(
|
||||
function(details) {
|
||||
console.log("Request intercepted for URL:", details.url);
|
||||
// 이 예시는 단순히 로그를 남기므로 요청을 변경하거나 차단하지 않음
|
||||
return {};
|
||||
},
|
||||
{urls: ["<all_urls>"]}, // 모든 URL에 대해 요청 듣기
|
||||
[]
|
||||
);
|
||||
@@ -316,7 +316,9 @@ if (keywords.every(keyword => !url.includes(keyword))) {
|
||||
document.addEventListener('touchend', function(e) {
|
||||
|
||||
setTimeout(() => {
|
||||
autoScrollAndSave();
|
||||
if(location.href.search("ijavtorrent") < 0) {
|
||||
autoScrollAndSave();
|
||||
}
|
||||
}, 5);
|
||||
});
|
||||
}
|
||||
@@ -468,9 +470,9 @@ function ytDown() {
|
||||
|
||||
}
|
||||
|
||||
function handleCommon() {
|
||||
async function handleCommon() {
|
||||
// 공통 광고 제거
|
||||
alert(JSON.stringify({COOKIES : document.cookie}))
|
||||
alert(JSON.stringify({COOKIES: document.cookie}))
|
||||
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();
|
||||
@@ -495,8 +497,11 @@ function handleCommon() {
|
||||
}
|
||||
|
||||
|
||||
if (location.href.search("javt") > -1 &&document.querySelectorAll('[class^="col-md-4 mb-4 video-item"]').length > 1) {
|
||||
if (location.href.search("javt") > -1 && 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 {
|
||||
@@ -609,11 +614,39 @@ function handleCommon() {
|
||||
}
|
||||
);
|
||||
|
||||
gotoNext()
|
||||
// gotoNext()
|
||||
|
||||
}
|
||||
else if(location.href.search("javt")) {
|
||||
console.log(`Found TEST`);
|
||||
const imageSelector = 'img[class*="mw-100"][src*="images"]';
|
||||
const images = Array.from(document.querySelectorAll(imageSelector));
|
||||
console.log(`Found ${images}`);
|
||||
if (images.length > 0) {
|
||||
const validImageUrls = images.map(img => img.src)
|
||||
.filter(src => src && src.startsWith('http'));
|
||||
const uniqueUrls = [...new Set(validImageUrls)];
|
||||
|
||||
console.log(`Found ${'$'}{uniqueUrls.length} unique images to cache.`);
|
||||
|
||||
// 3. 각 URL을 순회하며 Base64로 변환하고 즉시 네이티브로 전송
|
||||
// (모든 작업을 병렬로 처리하지 않고 순차적(또는 하나씩)으로 보내 메모리 부담을 줄임)
|
||||
for (const url of uniqueUrls) {
|
||||
const base64Data = await getBase64FromUrl(url);
|
||||
if (base64Data) {
|
||||
// 이미지 하나를 성공할 때마다 네이티브로 즉시 전송
|
||||
sendMessage({
|
||||
type: "SINGLE_IMAGE_DATA",
|
||||
imgSrc: url,
|
||||
base64Data: base64Data
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (window.scrollY < 5) {
|
||||
console.log("window.scrollY >>> " + window.scrollY)
|
||||
window.scrollTo({ top: 5, behavior: 'smooth' });
|
||||
window.scrollTo({top: 5, behavior: 'smooth'});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -642,7 +675,7 @@ function handleToreentZota() {
|
||||
}
|
||||
})
|
||||
var description = e.querySelector('.flex-none w-16 text-center').textContent + e.querySelector('.badge badge-third w-auto px-1 flex-none mr-2 float-left').textContent
|
||||
var md = e.querySelector(".flex-none w-14 text-center hidden md:block").textContent
|
||||
var md = e.querySelector(".flex-none w-14 text-center hidden md").textContent
|
||||
|
||||
let todayYear = new Date().getFullYear();
|
||||
let now = new Date();
|
||||
@@ -906,4 +939,23 @@ function autoScrollAndHandleDotax() {
|
||||
// // 시작
|
||||
// scrollAndSend();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function getBase64FromUrl(url) {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const blob = await response.blob();
|
||||
|
||||
// FileReader를 사용해 Blob을 Data URL (Base64)로 변환
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.onloadend = () => resolve(reader.result); // 결과 예: "data:image/png;base64,iVBORw0..."
|
||||
reader.onerror = reject;
|
||||
reader.readAsDataURL(blob);
|
||||
});
|
||||
} catch (e) {
|
||||
console.error("Base64 conversion error for:", url, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user