✨ Features: - App iOS completa para leer manga sin publicidad - Scraper con WKWebView para manhwaweb.com - Sistema de descargas offline - Lector con zoom y navegación - Favoritos y progreso de lectura - Compatible con iOS 15+ y Sideloadly/3uTools 📦 Contenido: - Backend Node.js con Puppeteer (opcional) - App iOS con SwiftUI - Scraper de capítulos e imágenes - Sistema de almacenamiento local - Testing completo - Documentación exhaustiva 🧪 Prueba: Capítulo 789 de One Piece descargado exitosamente - 21 páginas descargadas - 4.68 MB total - URLs verificadas y funcionales 🎉 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
79 lines
2.8 KiB
JavaScript
79 lines
2.8 KiB
JavaScript
// While filters are precompiled, pseudos get called when they are needed
|
|
export const pseudos = {
|
|
empty(elem, { adapter }) {
|
|
return !adapter.getChildren(elem).some((elem) =>
|
|
// FIXME: `getText` call is potentially expensive.
|
|
adapter.isTag(elem) || adapter.getText(elem) !== "");
|
|
},
|
|
"first-child"(elem, { adapter, equals }) {
|
|
if (adapter.prevElementSibling) {
|
|
return adapter.prevElementSibling(elem) == null;
|
|
}
|
|
const firstChild = adapter
|
|
.getSiblings(elem)
|
|
.find((elem) => adapter.isTag(elem));
|
|
return firstChild != null && equals(elem, firstChild);
|
|
},
|
|
"last-child"(elem, { adapter, equals }) {
|
|
const siblings = adapter.getSiblings(elem);
|
|
for (let i = siblings.length - 1; i >= 0; i--) {
|
|
if (equals(elem, siblings[i]))
|
|
return true;
|
|
if (adapter.isTag(siblings[i]))
|
|
break;
|
|
}
|
|
return false;
|
|
},
|
|
"first-of-type"(elem, { adapter, equals }) {
|
|
const siblings = adapter.getSiblings(elem);
|
|
const elemName = adapter.getName(elem);
|
|
for (let i = 0; i < siblings.length; i++) {
|
|
const currentSibling = siblings[i];
|
|
if (equals(elem, currentSibling))
|
|
return true;
|
|
if (adapter.isTag(currentSibling) &&
|
|
adapter.getName(currentSibling) === elemName) {
|
|
break;
|
|
}
|
|
}
|
|
return false;
|
|
},
|
|
"last-of-type"(elem, { adapter, equals }) {
|
|
const siblings = adapter.getSiblings(elem);
|
|
const elemName = adapter.getName(elem);
|
|
for (let i = siblings.length - 1; i >= 0; i--) {
|
|
const currentSibling = siblings[i];
|
|
if (equals(elem, currentSibling))
|
|
return true;
|
|
if (adapter.isTag(currentSibling) &&
|
|
adapter.getName(currentSibling) === elemName) {
|
|
break;
|
|
}
|
|
}
|
|
return false;
|
|
},
|
|
"only-of-type"(elem, { adapter, equals }) {
|
|
const elemName = adapter.getName(elem);
|
|
return adapter
|
|
.getSiblings(elem)
|
|
.every((sibling) => equals(elem, sibling) ||
|
|
!adapter.isTag(sibling) ||
|
|
adapter.getName(sibling) !== elemName);
|
|
},
|
|
"only-child"(elem, { adapter, equals }) {
|
|
return adapter
|
|
.getSiblings(elem)
|
|
.every((sibling) => equals(elem, sibling) || !adapter.isTag(sibling));
|
|
},
|
|
};
|
|
export function verifyPseudoArgs(func, name, subselect, argIndex) {
|
|
if (subselect === null) {
|
|
if (func.length > argIndex) {
|
|
throw new Error(`Pseudo-class :${name} requires an argument`);
|
|
}
|
|
}
|
|
else if (func.length === argIndex) {
|
|
throw new Error(`Pseudo-class :${name} doesn't have any arguments`);
|
|
}
|
|
}
|
|
//# sourceMappingURL=pseudos.js.map
|