bw的自动翻页代码求更新
Opened this issue · 7 comments
之前的失效了,不知该怎么改
I'm getting the same error, the page turn function won't work. Hopefully it can be fixed soon
Updated, please use:
window.i=0;setInterval(()=>{NFBR.a6G.Initializer.d9M.menu.options.a6l.moveToPage(window.i);console.log(window.i);window.i++;},3000)
Updated, please use:
window.i=0;setInterval(()=>{NFBR.a6G.Initializer.d9M.menu.options.a6l.moveToPage(window.i);console.log(window.i);window.i++;},3000)
Thank you! Works perfectly again.
新函數 NFBR.a6G.Initializer.L7v.menu.options.a6l.moveToPage
新函數 NFBR.a6G.Initializer.L7v.menu.options.a6l.moveToPage
Thanks!
Will consider adding an auto click turn pages feature in the browser, so we could auto turn pages no matter how they update the script.
新函數 NFBR.a6G.Initializer.L7v.menu.options.a6l.moveToPage
Thanks! Will consider adding an auto click turn pages feature in the browser, so we could auto turn pages no matter how they update the script.
Before we implement that, here's a workaround to detect updated javascript, rewritten from website_actions
.
I've also added the check_is_loading
function which avoids missing pages.
It's tested on bookwalker.com.tw, and should also work for bookwalker.jp
I'd appreciate others testing it and letting me know if it works for you as well.
function isLoaded() {
for (e of document.querySelectorAll('.loading')) {
if (getComputedStyle(e).visibility === "visible") return false;
}
return true;
}
let options;
for (key of Object.keys(NFBR.a6G.Initializer)) {
if (Object.keys(NFBR.a6G.Initializer[key]).includes('menu')) {
options = NFBR.a6G.Initializer[key].menu.options.a6l;
break;
}
}
options.setSpreadDouble(false);
const total = parseInt(document.querySelector('#pageSliderCounter').innerText.split('/')[1])
const checkLoading = setInterval(function() {
const current = parseInt(document.querySelector('#pageSliderCounter').innerText.split('/')[0])
console.log('Waiting for page', current);
if (isLoaded()) {
console.log('Page loaded');
if (current < total) {
options.moveToNext();
} else {
console.log('Finished!');
clearInterval(checkLoading);
}
}
}, 1000);