..
This commit is contained in:
@@ -361,10 +361,26 @@ function toast(msg) {
|
||||
|
||||
var mainContentsEl = null
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
if (port) {
|
||||
sendMessage({type: "MSG", msg: "connect prot"});
|
||||
time1 = setTimeout(autoScrollAndSave(false), 3500)
|
||||
|
||||
const currentUrl = location.href;
|
||||
|
||||
// 여기에 제외하고 싶은 문자열 배열을 넣으면 됨 (예: 관리자 페이지, 로그인 페이지 등)
|
||||
const excludedStrings = [
|
||||
'booktoki',
|
||||
'manatoki',
|
||||
'x.com',
|
||||
'newtoki',
|
||||
'youtube',
|
||||
'perplexity',
|
||||
// 필요하면 더 추가
|
||||
];
|
||||
|
||||
// currentUrl에 excludedStrings에 있는 문자열이 하나라도 포함되면 true
|
||||
const shouldExclude = excludedStrings.some(str => currentUrl.includes(str));
|
||||
|
||||
if (port && !shouldExclude) {
|
||||
toast("connect port on " + location.href);
|
||||
time1 = setTimeout(autoScrollAndSave(false), 3500);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -726,12 +742,12 @@ async function handleCommon() {
|
||||
.filter(src => src && src.startsWith('http'));
|
||||
const uniqueUrls = [...new Set(validImageUrls)];
|
||||
|
||||
console.log(`Found ${'$'}{uniqueUrls.length} unique images to cache.`);
|
||||
// console.log(`Found ${'$'}{uniqueUrls.length} unique images to cache.`);
|
||||
|
||||
|
||||
for (const image of uniqueUrls) {
|
||||
|
||||
}
|
||||
// for (const image of uniqueUrls) {
|
||||
//
|
||||
// }
|
||||
// 3. 각 URL을 순회하며 Base64로 변환하고 즉시 네이티브로 전송
|
||||
// (모든 작업을 병렬로 처리하지 않고 순차적(또는 하나씩)으로 보내 메모리 부담을 줄임)
|
||||
var idx = 0
|
||||
@@ -770,7 +786,7 @@ async function handleCommon() {
|
||||
// 현재 스크롤 위치 + 화면에 보이는 높이가 전체 페이지 높이보다 크거나 같으면
|
||||
// 페이지의 끝에 도달한 것입니다.
|
||||
if (Math.ceil(window.scrollY) + Math.ceil(window.innerHeight) >= (totalHeight * 0.9)) {
|
||||
console.log("✅ 페이지 끝에 도달했습니다. 스크롤을 중지합니다.");
|
||||
// console.log("✅ 페이지 끝에 도달했습니다. 스크롤을 중지합니다.");
|
||||
toast("✅ 페이지 끝에 도달했습니다. 스크롤을 중지합니다.")
|
||||
clearInterval(scrollInterval); // 반복 실행을 멈춥니다.
|
||||
getImg()
|
||||
@@ -781,7 +797,7 @@ async function handleCommon() {
|
||||
left: 0,
|
||||
behavior: 'smooth' // 부드럽게 스크롤하는 옵션
|
||||
});
|
||||
toast(`smooth scrollBy ${scrollIncrement}, ${window.scrollY}, ${window.innerHeight}, ${totalHeight}`)
|
||||
// toast(`smooth scrollBy ${scrollIncrement}, ${window.scrollY}, ${window.innerHeight}, ${totalHeight}`)
|
||||
}
|
||||
}, 2000); // 1000밀리초 = 1초
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user