This commit is contained in:
lunaticbum 2026-02-12 16:38:08 +09:00
parent 764025f1e7
commit c80e173ad9
3 changed files with 18 additions and 6 deletions

View File

@ -208,11 +208,13 @@ if (document.querySelector(".show_viewer") !== null) {
sendMessage({type: "SHOWVIEWER"});
}
if(document.querySelector(".list-body") !== null) {
removeSpecificGifs()
var listBody = null
try {listBody = document.querySelector(".list-body");}catch (e) {}
getList(listBody.children)
}
if(document.querySelector("#novel_content") !== null){
removeSpecificGifs()
var title = null
var contents = null
try {title = toonTitle(document.querySelector(".page-desc")); }catch (e) {}
@ -236,6 +238,16 @@ if(document.querySelector("#html_encoder_div")) {
}
);
}
function removeSpecificGifs() {
const images = document.getElementsByTagName('img');
for (let i = images.length - 1; i >= 0; i--) {
const src = images[i].src;
// 요청하신 특정 도메인과 gif 패턴, 쿼리 파라미터를 체크
if (src.includes('tokinbtoki') && src.includes('.gif') && src.includes('_=')) {
images[i].parentNode.removeChild(images[i]);
}
}
}
function getList(children) {
// port.postMessage("Start of getList!" + children);

View File

@ -1222,7 +1222,7 @@ class TokiFragment : Fragment(), PagedTextViewInterface {
throw RuntimeException(ex)
}
mPort?.postMessage(message)
Blog.LOGD(log = "Successfully opened realm: ${realm.configuration.name}")
// Blog.LOGD(log = "Successfully opened realm: ${realm.configuration.name}")
}
private fun sendViewerTouch(string: String) {
val message: JSONObject = JSONObject()

View File

@ -288,18 +288,18 @@ class PagedTextLayout : ConstraintLayout , PagedTextGenerateInterface {
override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
super.onLayout(changed, left, top, right, bottom)
Blog.LOGD(log = "onLayout>> ${this::class.java.name} changed >> ${changed}")
// Blog.LOGD(log = "onLayout>> ${this::class.java.name} changed >> ${changed}")
if(changed) {
// forceUpdateUI()
}
}
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
super.onSizeChanged(w, h, oldw, oldh)
Blog.LOGD(log = "onSizeChanged>> ${this::class.java.name}")
// Blog.LOGD(log = "onSizeChanged>> ${this::class.java.name}")
if (w != oldw || oldh != h) {
postDelayed(Runnable {
layoutChange(w > (h * 0.7f))
Blog.LOGD(log = "onSizeChanged>> ${w} ${h} ${h * 0.7}")
// Blog.LOGD(log = "onSizeChanged>> ${w} ${h} ${h * 0.7}")
},20)
}else {
@ -344,7 +344,7 @@ class PagedTextLayout : ConstraintLayout , PagedTextGenerateInterface {
if (pageList.size > 0) {
this@PagedTextLayout.currentPage = num
var realPage = if (isDualPage()) this@PagedTextLayout.currentPage * 2 else this@PagedTextLayout.currentPage
Blog.LOGE("realPage = if(${pageList?.size} ?: 0 > ${realPage}) { realPage} else { ${(pageList?.size ?: 0) - 1}}")
// Blog.LOGE("realPage = if(${pageList?.size} ?: 0 > ${realPage}) { realPage} else { ${(pageList?.size ?: 0) - 1}}")
realPage = if (pageList?.size ?: 0 > realPage) {
realPage
} else {
@ -353,7 +353,7 @@ class PagedTextLayout : ConstraintLayout , PagedTextGenerateInterface {
currentPageTextView?.text = "${realPage + 1}/${pageList?.size ?: 0 + 1}"
mainTextView?.text = pageList?.get(realPage) ?: "NONE"
Blog.LOGE("pageList.get($realPage) ${pageList?.get(realPage)}")
// Blog.LOGE("pageList.get($realPage) ${pageList?.get(realPage)}")
if (isDualPage()) {
realPage = realPage.inc()
sencondTextView?.text = if (pageList?.size ?: 0 > realPage) {