Fybertech Forums

Projects and Development => Programmerin' => UserJS Scripts => Topic started by: FyberOptic on May 31, 2006, 09:37:34 pm

Title: 4chan UserJS Script
Post by: FyberOptic on May 31, 2006, 09:37:34 pm
CROSSPOSTEDDDDD


The 4chan extension for Firefox has a few nice things to offer, and I've found myself using that browser to peruse 4chan at times, even though my primary browser is Opera.  Unfortuantely, nobody seems to have ever written any enhancements for it (that I've ever found), so I decided to write one myself!

http://www.fybertech.com/userjs/fychan.js

This mostly implements the feature I prefer most; loading a full thread right inside the page, instead of loading a seperate page to see the omitted posts.  Just in the time I've been testing it, I've already been finding it pretty useful.

In any case, this is a UserJS script for anyone not in the know.  It's Opera's version of an extension language.  I've found myself using it a lot lately, not just to add features to websites, but to fix other ones that won't work properly in Opera.  It's great.

If you don't know how to install a UserJS script, it's simple.  You can either read the elaborate explantion at http://userjs.org/help/installation , or just:  Go to Tools, Options, Preferences, then the Advanced tab, pick the Content section, click Javascript Options.  In the "My Javascript files" blank, put like "c:\userjs" (minus the quotes), then create that folder on your computer, and copy the script inside.  You'll probably want to right-click/save-as to get the script onto your computer, mind you.

Anyway, if anyone wants to mess around with it and see if they can find any  problems, feel free.  I'm also welcome to suggestions of things to add.  Hope some folks find it useful!
Title: Re: 4chan UserJS Script
Post by: Spug on June 01, 2006, 02:30:05 am
My hero  :-*
Title: Re: 4chan UserJS Script
Post by: FyberOptic on June 01, 2006, 10:06:30 am
That's the post I put on their Programming BBS board, and linked to it fralm one in /g/, btw.

The script seems to be warkin good for folks, though a couple mentioned they'd like to be able to shrink the threads back down afterwards, so I'll add that in today.  It's also crowding the text a little in one place, and getting a DOM error on the BBS boards, but those should be simple fixes.

HOORAY USERJS?
Title: Re: 4chan UserJS Script
Post by: Ki_Shodar on July 25, 2006, 04:33:29 am
any chance of getting a copy that still works with Opera 8.54?

latest version only works in Opera 9 which I'm not really liking at the moment
Title: Re: 4chan UserJS Script
Post by: FyberOptic on July 25, 2006, 01:44:27 pm
I actually made a copy of the old version just in case anyone ever needed it.  You can get it here (http://www.fybertech.com/userjs/fychan8.js).

How come you're not liking Opera 9, out of curiosity?


P.S.  Anyone else here that uses this script, I did in fact upgrade it some over the past couple weeks or so, but forgot to mention it here.  The link in the first post will get the new version.
Title: Re: 4chan UserJS Script
Post by: Ki_Shodar on July 26, 2006, 04:12:45 am
Seems to run noticeably slower for me compared to 8.54, and I don't like the way going back pages in the history has changed in 9 (In 8.54 the previous pages load instantly, unlike 9 which seems to check for updates to some of the pages you've visited). Annoying enough for me to keep using 8 for the time being.

Grabbed that version 8 copy of the script, but it's not working very well - previous/next buttons don't work at all and their bars are all over the place.
And links are back to using the javascript open method. Had regular links in one of the versions that worked in 8 before I upgraded to the Opera 9 only version.
Title: Re: 4chan UserJS Script
Post by: FyberOptic on December 21, 2006, 11:07:14 pm
4chan made some code changes for their new ads and stuff, so I made another little update to accomodate for it.  Same link as above (http://www.fybertech.com/userjs/fychan.js) to grab it.
Title: Re: 4chan UserJS Script
Post by: FyberOptic on April 25, 2007, 12:30:41 am
I upgraded this script a bit as I've been wanting a couple of certain features, so hopefully you guys will find them useful as well.  Download link same as above.

New stuff:

- Inline image expansion.  Like in the Firefox extension, clicking a thumbnail will load the image right in the page.  You can turn this off with a setting in the UserJS file if you prefer, but clicking the filename or middle-clicking the thumb will open it in a new window like always.  Initially I disabled interstitial ads for this to work correctly, but then I rewrote how it worked so that it would still function properly while keeping ads intact.  I haven't noticed any problems from having done so, but if it acts up, just let me know.

- Added an "All Images" command to the thread ID bar.  Clicking this lets you open all images in a thread at once.  If you try to open more than 15 (by default), it'll ask you to confirm.  I did kind of a last minute fix so that this would work on reply pages as well, so hopefully I didn't break anything.  Note that this WON'T WORK if you have popup blocking enabled for 4chan.  You can disable that explicitly for 4chan by right-clicking the page and picking "Edit site preferences", then preferably selecting "Open pop-ups in background".  You may have to do this once for each of 4chan's servers that you visit (zip, img, orz, etc).

- Added a minor fix so that it would load the default stylesheet, since for whatever reason, it wasn't working in Opera.
Title: Re: 4chan UserJS Script
Post by: Buzzard on April 25, 2007, 02:18:48 pm
Awesome, I totally forgot to update this after they redid a little bit of 4chan and it made it all screwy. Hopefully this is better, which it should be.
Title: Re: 4chan UserJS Script
Post by: juggy on June 29, 2008, 10:29:12 am
YOU ARE TOTALLY GREAT!!!

Like you said yourself in your first post there are nothing like this for Opera which is a big shame...

I just love this, no need to open all the pics by clicking on each of them anymore if you need to open them all and nearly no need for me to use firefox anymore *.*

Thanks, thanks and thanks a lot for this extension.

oh yeah forgot nearly what it was I was going to ask XD

Could I ask you, if it's not too much to ask, to make a grab and save function like the "not4chan Grab Extension" (A Firefox extension to help grab images on not4chan or similar image board) and make it more general so it can also be used on similar image boards too?

Clicking and saving all those pics one by one takes time plus opening about 50 tabs takes up mem.  :'(

I hope I'm not asking for the impossible and I apologize if I in any way have been offending because of my low knowledge of programmering and with opera too.

Again thanks a lot for the plug-in.
Title: Re: 4chan UserJS Script
Post by: FyberOptic on June 29, 2008, 03:50:39 pm
Hey thanks for the praise, I'm glad you get as much use out of it as myself.

Opera actually has a neat links feature built in, making it easy to grab all the images or whatever off of a page.  Control + Shift + L is the default keyboard shortcut now I think, or you can just go to the Tools menu and pick Links.  It shows you all the clickable things on a page. 

To save all the images from a thread on 4chan, load the thread in question in its own window, bring the links window up, then put this into the search blank along the top:

/src/1

This filters only things coming from the /src/ directory on 4chan, and files starting with "1" immediately after it.  If you don't put the 1, you'll get some duplicates in the list, I noticed.  Images on 4chan should always start with a 1, because they save them based on the unix timestamp apparently, meaning it won't become a 2 until the year 2033!  You might not need the 1 on other image boards, though, depending on what type of chan software they use.

But anyhow, then you can select however many images you want to save.  Control-A will just select everything.  Then you can right-click on'em, and either pick the Save As feature, or Save to Download Folder.  If you pick the first one, I think it prompts you for every file.  If you pick the other option, it saves them all with no prompting to whatever folder you have set in Opera as your download folder.

Hope that helps!
Title: Re: 4chan UserJS Script
Post by: juggy on July 02, 2008, 11:07:55 am
FyberOptic, if you were a girl I'd kiss you

This is exactly what I've been looking for and the best thing is that it works for more than just pictures. You lilttle guide to how it works was easy to understand too so I'm going crazy with the certain opera functionality. This just made Firefox become trash for me and trash goes into the trashbin. :D

Lots of thanks for answering and this fast.
Title: Re: 4chan UserJS Script
Post by: FyberOptic on July 13, 2008, 11:44:51 pm
I updated the script some more.  Partially it was to clean the code since I entered it in the UserJS competition on the Opera site, but it also fixed some bugs and added minor functionality.
Title: Re: 4chan UserJS Script
Post by: lobotomoy on August 29, 2008, 12:15:37 am
Would it be possible to add a Hide Thread function like in the Firefox extension?
Title: Re: 4chan UserJS Script
Post by: FyberOptic on August 29, 2008, 10:52:47 am
I've actually thought about adding that in, since it wouldn't be hard.

I haven't worked on the script much lately due to other projects, but it's still in the middle of being upgraded to be able to store more settings.  That'll let me implement a thread watcher finally!
Title: Re: 4chan UserJS Script
Post by: wanon on January 16, 2009, 10:11:22 am
I fucking love you have my babies please

Oh btw I was really wondering if there is a way to do the watch thread function like in firefox?:( I am quite in need of that because I am often lost

yes opening tabs work but with 15 pages now and me doing other stuffs I really would appreciate it
Title: Re: 4chan UserJS Script
Post by: FyberOptic on January 16, 2009, 10:17:51 pm
Hey, and welcome!  

A while back I actually started work on a way to store more data other than with a browser cookie so that I could implement a thread watch, but I ended up being distracted by other things and never got back to it.  But it seems entirely possible based on last I messed around with it, so it's just a matter of getting back into updating it.  Usually it took 4chan doing a site update which broke something in the script, prompting me to go ahead and update other features as well, but they surprisingly haven't broken anything in a while!
Title: Re: 4chan UserJS Script
Post by: wanon on April 11, 2009, 11:38:25 pm
Hello good sir I know this isn't tech support but I really have a problem

now you see since I upgraded to this shit called opera turbo the JS wont work anymore :(

Can you please see into this?:(

So I already got this opera 10.00 alpha but then I upgraded to opera turbo(that is 10.00 1) and yeah the js won't really work

probably because of opera's anal philosophy amirite?:(
Title: Re: 4chan UserJS Script
Post by: FyberOptic on April 16, 2009, 01:09:54 am
Sometimes things in those alphas break stuff and get fixed later, and other times they change or improve things which still ends up breaking stuff.  Either way I'll have to download it when I get a chance and see what's up!
Title: Re: 4chan UserJS Script
Post by: FyberOptic on October 03, 2009, 11:21:50 pm
I haven't been using Opera or even 4chan much lately.  But today I realized that the Fychan script had a bug with Opera 10: the page navigation bar was missing.  I was kind of surprised nobody emailed to tell me, but no biggy.  It was a minor fix.  However, there's a bunch of other modifications under the hood which I made to the script a while back, so they're in this update as well.

Since this is page 2 of the thread, I'll give a link again:  http://www.fybertech.com/userjs/fychan.js

Title: Re: 4chan UserJS Script
Post by: Hyde on December 22, 2009, 08:10:02 am
First of all, Thank you very much!
Now, the quick replay function is broken in Opera 10.5, can you fix it please?
Title: Re: 4chan UserJS Script
Post by: boon on December 22, 2009, 10:44:15 am
stuff semi broke again, i'm running opera 10.10 and i just got the latest fychan.js just to be sure. 1.1
the next/previous buttons don't work
overall damn good script, been using it forever.
Title: Re: 4chan UserJS Script
Post by: FyberOptic on December 22, 2009, 12:53:06 pm
First of all, Thank you very much!
Now, the quick replay function is broken in Opera 10.5, can you fix it please?

Well, I'm using Opera 10.10, and didn't notice any problem with the quick-replying.  However, I did notice a problem with the return-to-thread functionality, which you may have been referring to.  I can't say for sure unless you elaborate on the problem you had.  But in any case, I did fix the return-to-thread code. 

stuff semi broke again, i'm running opera 10.10 and i just got the latest fychan.js just to be sure. 1.1
the next/previous buttons don't work
overall damn good script, been using it forever.

Buttons are now fixed.  And thanks for the kind words!


Both of these problems were due to 4chan updating their html, which happens once in a while.  Hopefully the changes I made will allow it to adapt a bit more easily in case they do so again, but I suppose we'll see when/if they update further.  In any case, if anything breaks again, just let me know.  I don't go there every day so I'll trust others to report any problems when they pop up.
Title: Re: 4chan UserJS Script
Post by: boon on December 22, 2009, 02:06:48 pm
wow that was fast response.

yeah i remember notifying you wayyyy previously and i didn't know if i had an account to post but i guess i did.
also nice to know fychan works in chrome too.  i gotta try that.
Title: Re: 4chan UserJS Script
Post by: DarkHaunter on December 23, 2009, 04:08:57 pm
Hi there,

Just wanted to ask if for some reason you've missed my e-mails (and messages in the Opera Community thread), or you're not interested in the improvements I've done to the script? I see you mentioned that you don't use Opera and browse 4chan lately, however I'm interested in further improving fychan. Have a look here: http://my.opera.com/community/forums/findpost.pl?id=3543721
Title: Re: 4chan UserJS Script
Post by: FyberOptic on December 23, 2009, 08:37:22 pm
Hi there,

Just wanted to ask if for some reason you've missed my e-mails (and messages in the Opera Community thread), or you're not interested in the improvements I've done to the script? I see you mentioned that you don't use Opera and browse 4chan lately, however I'm interested in further improving fychan. Have a look here: http://my.opera.com/community/forums/findpost.pl?id=3543721

Your email got lost in the mix, actually, but I do see it now.  And I haven't thought to check the Opera thread in ages.  I thought I was subscribed to it for updates, but apparently not anymore!  Glad you posted here to bring it to my attention.

I am using Opera lately though, and still browse 4chan occasionally when not involving myself in other things/projects.  It's not so much that I'm disinterested in updating the script, since I still maintain it to ensure it works.  It's just that Fychan pretty much just came to be as a result of features I wanted for the site, and whenever I come across the need for something else, I add that in as well.  For example, I don't go to /b/ much anymore (mostly like r9k, wg, and g) so I personally haven't had to deal with thread bombs or anything very much these days. 

That said, I've taken a peek at your code and tried out your latest version of the script.  I can't test the thread bomb prevention at the moment, obviously.  But I do think it and the other two additions are interesting.  I personally like to see saged posts as well as everything else, so I wouldn't use that one myself, though I'm sure others would feel the same as you about it.  But I can see how hiding small images would be handy, particularly in the case of spam.  And shrinking the performance info header is nice. 

Since you seem eager to introduce new features, then you're more than welcome to continue maintaining a patch and/or alternate edition, since you likely to visit 4chan more often than me (particularly, sections I don't frequent), and seem to have the skills to implement things you'd find handy.  And I certainly appreciate you simply modifying the script header to include yourself and not just ripping it off or anything. 

I don't know if I'll ever merge anything from them together, but I'll likely still continue to maintain my own version as I've been.  Mostly fixes, but once in a while the urge to update it with a feature strikes, so who knows!
Title: Re: 4chan UserJS Script
Post by: DarkHaunter on December 23, 2009, 08:40:04 pm
Thank you for the reply :) I'm actually adding a few more features at the moment, and going to keep maintaining my own mod in the Opera Community thread - but feel free to merge back in whatever you like.
Title: Re: 4chan UserJS Script
Post by: boon on February 26, 2010, 12:47:35 pm
opera 10.50 is in beta2 now and its looking really damn sexy, it looks like chrome now and it has finally enabled some things like tab view in the task bar like ie.  also a thinner and lower profile tab and top bar, makes it nice for netbooks.  anyway im using opera 10.50 right now and fychan is mostly working except the next button doesnt work anymore.  it does work fine in 10.1 so its probably the beta or something in 10.50 doing it.  just to let you know.

http://a.imouto.org/boon/watisdis/slick_opera.png (http://a.imouto.org/boon/watisdis/slick_opera.png)
link is a screenshot basically.  extra slick imo
Title: Re: 4chan UserJS Script
Post by: Psykorps on March 05, 2010, 02:52:34 pm
Hello
First, let me thank you for your effort, you've made browsing 4chan a lot better ;D

but there is one thing
I've installed Opera 10.50 final version, and the script hasnt been working correctly ever since.

In thread image expansion is not working properly - whenever I want to expand an image, the browser automatically scrolls to the end of the page

quoting function isnt working either, whenever I click on a post to reply to, the reply window pops up, but there is no >>post#

also, automatic return to thread/noko isnt working too

these are the only problems that I've been dealing with since the release of 10.50

Suggestion: How about adding a feature like backwash to fychan? In my opinion this is the only feature fychan is missing to be a one complete script

Thank you for your patience and support
Title: Re: 4chan UserJS Script
Post by: FyberOptic on March 07, 2010, 11:00:17 pm
Hiya Psykorps, welcome to the forums, and thanks for the compliments!

I'm glad you pointed out all of the things that are wrong, because from first glance I had only noticed a couple of them myself when I checked the other day.  I'd been told of some problems people had with the Opera beta, but as I learned with the Opera 10.0 beta, sometimes those things are fixed and aren't a problem anymore in the final.  I guess that's not so this time!

The return-to-thread feature has actually been acting up for me for a while now, ever since 4chan updated some of their code.  I tried making an update before, and then again recently just for that.  But then it seems it broke again, and only worked when replying to a thread rather than posting a new one.  It might be totally broken now for all I know.

Anyhoo, I'll dig through it when I can and see if I can get those problems ironed out.  As for backwash, I've never used it myself, but I can see how it might be neat.  Might be worth trying to implement something similar one day.
Title: Re: 4chan UserJS Script
Post by: boon on July 16, 2010, 10:40:13 am
oh please update fychan to fix the "next" button for opera 10.60,  i'll love you and its the best 4chan viewing addon for opera as well.