Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Javascript in 4chan 404 defeater

Name: Anonymous 2009-02-27 14:51

4chan 404 defeater is a Firefox extension used to auto refresh 4chan threads in Firefox until they 404 (without showing a 404 screen):
Website:
http://spacetaken.net/44d/

Firefox extension:
http://spacetaken.net/44d/4chan404defeater_0-4.xpi

Greasemonkey script:
http://spacetaken.net/44d/4chan404defeater_0-4.user.js

Inside that .xpi is chandefeater.js and it's identical to the Greasemonkey script. I've been using 4chan 404 defeater for a while and I don't know anything about Javascript.

I want to modify that .js so instead of the default (auto F5'ing turned off (unchecked) and refresh rate set at every 2 minutes), I want the default to be checked and 8 minutes.

From window.saveCookies, it evidently saves a cookie for each open tab, saving the scroll position (44d_scroll_pos), the F5 interval (44d_f5_rate), and whether auto F5'ing (44d_auto_f5) is on/checked/true or off/unchecked/false.

I can view those cookies in Firefox through Tools > Options > Privacy > Show cookies and doing a Search for 4chan.

If I edit the .js and change:
var autoF5Rate = readCookie("44d_f5_rate", 2);
to
var autoF5Rate = readCookie("44d_f5_rate", 8);
..that changes the default refresh rate to 8 minutes.

But if I change:
var autoF5 = readCookie("44d_auto_f5", false);
to
var autoF5 = readCookie("44d_auto_f5", true);
..it does nothing.

The terms "checked" and "auto_f5_checker" both appear 6 times in that .js

The term "document.getElementById("auto_f5_checker").checked" appears 3 times in that .js

I think it has something to do with "onlick" and ".checked"

I'm currently focuses on these portions of code:

unsafeWindow.updateAutoF5 = function(){
    var checked = document.getElementById("auto_f5_checker").checked;
    //stop or start auto f5ing
    if(checked)
        autoF5TimerId = setInterval('doF5()', 1000*60*autoF5Rate);
    else
        clearInterval(autoF5TimerId);
}

unsafeWindow.validateRate = function(){
    var field = document.getElementById("ref_rate_mins");
    autoF5Rate = parseFloat(field.value);
    if(isNaN(autoF5Rate)) autoF5Rate = 1;
    else if(autoF5Rate < 0.1) autoF5Rate = 0.1;
    field.value = autoF5Rate;        //update to possibly different-to-inputted value
    if(document.getElementById("auto_f5_checker").checked){
        clearInterval(autoF5TimerId);
        autoF5TimerId = setInterval("doF5()", Math.round(1000*60*autoF5Rate));
    }
}

window.saveCookies = function(){
    writeCookie("44d_scroll_pos", document.body.scrollTop);
    if(document.getElementById("auto_f5_checker")){
        writeCookie("44d_f5_rate", autoF5Rate);   
        writeCookie("44d_auto_f5", document.getElementById("auto_f5_checker").checked);
    }
}

How do I make it so auto F5'ing is turned on by default in that .js but can still be turned off by unchecking the box (created by window.controlNode)?

Name: Anonymous 2010-03-23 17:49

lol googling 4chan auto expand points to this thrad now :D

Name: Anonymous 2010-03-23 20:06

Name: Anonymous 2010-03-24 9:38

>>40
They do that to ensure you don't get stale data.

Name: Anonymous 2011-01-31 21:15

<-- check em dubz

Name: Anonymous 2011-02-03 0:50

Name: Anonymous 2011-03-23 1:15

>>1
>I want to modify that .js so instead of the default (auto F5'ing turned off (unchecked) and refresh rate set at every 2 minutes), I want the default to be checked and 8 minutes.

There's a very dirty way to do this in Greasemonkey. Edit the script.

Find the else that has the following after it:
clearInterval(autoF5TimerId);

Remove that and paste the code from the if above:
autoF5TimerId = setInterval('doF5()', 1000*60*autoF5Rate);

This makes it auto F5 no matter if the checkbox is checked or not. But you will no longer be able to change the refresh rate via the box, only by editing the live code.

To change the refresh rate to 8 minutes, find
readCookie("44d_f5_rate",

Then change the number after it to 8

You may also need to change the line above that (change the false to true).

Name: Anonymous 2011-03-23 8:14

setInterval('doF5()'
Please stop programming!

Name: Anonymous 2011-06-30 4:39

Could you make doF5 have a timeout so that it won't get stuck and require user input to cancel on worse connections?

Name: Anonymous 2011-07-16 9:10

why are ppl still posting in this thread then it is over two years old?

Name: Anonymous 2011-07-16 9:12

REQUESTING SAGETANK

Name: 1000 posts 2011-07-16 16:12

●█████▄▄▄▄▄▄▄▄
▄▅███████▅▄▃▂
███sage tank███████►
◥☼▲⊙▲⊙▲⊙▲⊙▲⊙▲☼◤

Name: barbour mens classic duffle 2011-12-01 22:43

There are many brands of <a href="http://www.barbourjackets-uk.org/"><strong>barbour fusilier</strong></a> in the market today. Each of the brand promises to bring out something new to the customers.

Name: Anonymous 2012-09-06 22:46

wat

Name: Anonymous 2012-09-07 1:11

so much effort for that 4chan shit

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List