To be honest I have not used it in a while. I just hit play on the ad, switch to another tab to do stuff, and come back later to click skip. It works even if you have it out of focus
They seem to have reused whatever code they had for Premium chapters. Premium chapters used to go gray and only show a part of the chapter. Of course they could be silently turning the "bonus chapters" into premium ones.
my problem isn't the script not working, it's the fact that i can't watch those f****ng ads no matter how many times i try.
"Update 2018-06-04 18:14 UTC: Apparently this doesn't work anymore (based on the latest posts on this thread as of this moment). RIP. I don't even like CN, so I probably won't fix it unless I get really bored again."
On the subreddit that we're not allowed to link to, there's a script that still seems to be working to skip ads. I'll copy paste it in case anyone wants it: It's more work than a greasemonkey script, but you know, it works for me. And for reference, I didn't write the script, I don't understand how the script works, and you should remember when you run scripts by people you don't know, you do so at your own risk.
You all can also use this script, you know? AFAIK it still works: https://forum.novelupdates.com/threads/qidian-adwall-defeater.47047/
Just tried that, all it did was autoplay the ad, and that was only after I disabled my Noscript/Adblocker. I don't think autoplaying an ad counts as an adblock. Also don't want to have to disable Noscript/enable a whole bunch of scripts I probably don't want to.
So, I fixed the code but apparently I need 5 posts or more to be able to post a code block or link lol. We just need to explicitly put _csrfToken into the query and somehow it will work (fetch's credentials: include should already do this tho, I'm not sure why just doing that isn't sufficient)
After spamming for a while, Code: // ==UserScript== // @name webnovel.com skip video ads // @namespace http://forum.novelupdates.com/ // @version 5 // @run-at document-end // @match http://webnovel.com/book/* // @match https://webnovel.com/book/* // @match http://www.webnovel.com/book/* // @match https://www.webnovel.com/book/* // ==/UserScript== //------------------------------------------------------------------------------ // This script is released to the public domain. No attribution is required. //------------------------------------------------------------------------------ // FIX - 5/6/18 // I'm not sure why we need to explicitly pass _csrfToken here (since we specified credentials: include) but hey it works! // // How frequently this script should check for new chapters. // // The amount is in milliseconds. const INTERVAL_CHAPTER_CHECK = 1000; // When a token is not ready yet, this is how much time we should wait // before trying again. // // The amount is in milliseconds. const INTERVAL_TOKEN_CHECK = 1000; function getCookie(name) { var value = "; " + document.cookie; var parts = value.split("; " + name + "="); if (parts.length == 2) return parts.pop().split(";").shift(); } /** * Check for new chapters and try to remove the adwall from them. */ function main() { Array.from( // Locked chapters. document.querySelectorAll('.cha-content._lock') ).forEach((lock) => { // Remove this class so this chapter won't be processed the next time // `main` is called. lock.classList.remove('_lock'); // Remove the video. const v = lock.closest('.chapter_content').querySelector('.lock-video'); if (v) { v.remove(); } // Element with the chapter content. const contentElement = lock.querySelector('.cha-words'); contentElement.style.opacity = '0.1'; // Get the ID for the series ("book"). // // Some chapters have the `data-bid` property, but not all of them. // That's why it's better to just get this from the URL. const bid = window.location.href.split('/book/')[1].split('/')[0]; // Get the ID for the chapter. const { cid } = lock.querySelector('[data-cid]').dataset; // Both ID are required. if (!bid || !cid) { return; } return fetch( `https://www.webnovel.com/apiajax/chapter/GetChapterContentToken?bookId=${bid}&chapterId=${cid}&_csrfToken=${getCookie("_csrfToken")}` , {credentials: "include"}) .then(resp => resp.json()) .then(data => { console.log(data); return data.data.token }) .then(token => encodeURIComponent(token)) .then(token => new Promise((resolve) => { // The raw body of the chapter. // // It will be plain text, so we must manually build the HTML for it. let content = ''; // Try to get the content of the chapter, and fulfill the promise once // we have it. // // This function will retry until it succeeds. function tick() { const url = `https://www.webnovel.com/apiajax/chapter/GetChapterContentByToken?token=${token}&_csrfToken=${getCookie("_csrfToken")}`; fetch(url, {credentials: "include"}) .then(resp => resp.json()) .then((data) => { content = data.data.content.trim(); if (content) { resolve(content); } else { setTimeout(tick, INTERVAL_TOKEN_CHECK); } }) .catch((err) => { console.error(err.stack); tick(); }); } tick(); })) .then((content) => { // Build the HTML for the chapter content. // // For now we only split on line breaks and wrap each piece // with "<p></p>" tags. const chapterHtml = content .split('\n') .map(p => p.trim()) .filter(p => !!p) .map(p => `<p>${p}</p>`) .join(''); // Update the chapter content and turn opacity back to 100%. contentElement.innerHTML = chapterHtml; contentElement.style.opacity = '1'; }) .catch((err) => { console.error(err); }); }); } // Since Qidian may load new chapters without refreshing the page, we must // continuously check for new chapters in the page. setInterval(main, INTERVAL_CHAPTER_CHECK);
Any way to make it work with NoScript? it works when allowing webnovel and yueimg but that is two scripts i do not want to allow. Thanks for updating it tho, appreciate it ^_^