• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Hide Forum Threads - A Tampermonkey script for hiding unwanted GAF threads

Yup.

EDIT: And now it's working again. Weird.

EDIT2: Oh, I was on my subscriptions page. It won't work on that.

First off, awesome avatar. It took me a second to realize what was going on rofl.

Second, this is what I'm seeing. I'm on my work machine which sometimes gives me weird problems on the internet, so I'll check to see if my home machine is still working.

20z99om.png
 

JeTmAn81

Member
First off, awesome avatar. It took me a second to realize what was going on rofl.

Second, this is what I'm seeing. I'm on my work machine which sometimes gives me weird problems on the internet, so I'll check to see if my home machine is still working.

20z99om.png

It might be running into some kind of error which would show up in the Javascript console (hitting the F12 key will probably show this). But without knowing what the error is, I probably can't fix it.
 
It might be running into some kind of error which would show up in the Javascript console (hitting the F12 key will probably show this). But without knowing what the error is, I probably can't fix it.

I'm a fucking idiot is what the problem is. My tampermonkey was disabled.
 

CheesecakeRecipe

Stormy Grey
Not sure what just happened, but a little while ago I noticed my blocked threads were showing up again. Tampermonkey is still active, and the Control Panel for the extension still displays, but I no longer have the option to block any topics. Additionally, my entire list of blocked topics appears to have gone missing from the CP. I tried re-initializing both the plugin and Chrome, but the problem still persists.
 

paparazzo

Member
Not sure what just happened, but a little while ago I noticed my blocked threads were showing up again. Tampermonkey is still active, and the Control Panel for the extension still displays, but I no longer have the option to block any topics. Additionally, my entire list of blocked topics appears to have gone missing from the CP. I tried re-initializing both the plugin and Chrome, but the problem still persists.
Same thing happened to me. What fixed it was going extensions, check dev tools, click update extensions (had to click multiple times) which updated tampermonkey to 3.12, and it worked again.
 

CheesecakeRecipe

Stormy Grey
Same thing happened to me. What fixed it was going extensions, check dev tools, click update extensions (had to click multiple times) which updated tampermonkey to 3.12, and it worked again.

No go for me, the extension was already at 3.12 when I noticed this problem happened. I attempted an update anyways and even uninstalled/reinstalled tampermonkey, and the plugin is still only half functioning as before.
 

JeTmAn81

Member
No go for me, the extension was already at 3.12 when I noticed this problem happened. I attempted an update anyways and even uninstalled/reinstalled tampermonkey, and the plugin is still only half functioning as before.

Not sure what's going on there, though if you PM me your cloud storage password I'll most likely be able to retrieve your settings and send them to you, that way they're not lost completely.

BTW folks, I've been hosting the backend stuff for the cloud saving via Amazon Web Services and MongoDB. Both are free, but the AWS free tier is going to run out within a few months and I can't keep it going as a paid account. So if anyone knows of a free option for running a web service that can connect to the database, let me know. Also, if anyone wants to chip in to keep this going on AWS or some other paid but hopefully cheap provider, let me know. Otherwise the cloud saving option is going offline.
 

CheesecakeRecipe

Stormy Grey
I was able to fix it easily by replacing each instance of the http:// version of GAF with https://

I unfortunately lost my thread blocklist, but it probably could have used a pruning since I never activated thread expiry in the first place~
 

JeTmAn81

Member
Can't you do a search and replace in a text editor? That's what I did. I think it said there were 9 instances, but I don't know the location.

Yes you can just copy the text and do a find and replace for a quick fix. In Tampermonkey or whatever you're using there should be a place where you can view the script. In the meantime I'll post an update on Greasy Fork when i get a chance.
 

Manu

Member
Does this not work on FireFox anymore? The X to hide threads never comes up.

EDIT: Nevermind, I got it to work. Thanks.
 

JeTmAn81

Member
OK, I've posted an updated version on GreasyFork. I should warn you that you'll probably want to copy over your filter settings from LocalStorage before updating the script since it will create a new LocalStorage area for https://www.neogaf.com and the old one for http://www.neogaf.com won't be accessible anymore.

However, if you did already update the script and lose your settings as I did, you can restore them by deleting the current LocalStorage files for https and renaming your old http files to start with https instead. I can confirm that this does work and it let me use all my old settings again. As an example, the LocalStorage files for Chrome are found in C:\Users\yourusernamehere\AppData\Local\Google\Chrome\User Data\Default\Local Storage on my machine.
 

JeTmAn81

Member
Whee, apparently GAF reverting from SSL (https) broke it again! I'll look into whether or not there's an option for simply supporting either one that's being used but that will probably take me a bit of troubleshooting time.

For a quick fix, make sure you're browsing GAF with https at the beginning (which still works) and the script will start working.
 

dofry

That's "Dr." dofry to you.
Did this stop working totally or is it just me?

I assume because https has been a bit wonky at Neogaf recently that any fixes for this script needs to wait out a bit until everything settles.
 

JeTmAn81

Member
Did this stop working totally or is it just me?

I assume because https has been a bit wonky at Neogaf recently that any fixes for this script needs to wait out a bit until everything settles.

Yeah, I still haven't sat down and really figured out a solution that will work for both http and https. You can do a replace for "https" with "http" in the current script and that worked for me.
 

Ikuu

Had his dog run over by Blizzard's CEO
It works fine, you just need to edit the script and change the https to http.
 

JeTmAn81

Member
I've been loathe to update the script again to go back to http since I figured GAF would fix the https thing sooner or later, but I've now updated it so if you accept the update it should get fixed automatically. Of course, if GAF does end up going back to https I'll have to update it...again.
 
I've updated, but it doesn't seem to be working :\

EDIT:

Same problem I had last time. Tampermonkey somehow keeps disabling itself in Chrome. Enabled it and it's working again. Sorry.
 
I noticed this morning that the script had stopped working again intermittently - it worked when using my neogaf bookmark, but not when using links within the site to switch forums.

Turns out the forum link URLs now have an ampersand after the question mark, so adding that to the include URL at the top of the script fixed the issue.
 

JeTmAn81

Member
I noticed this morning that the script had stopped working again intermittently - it worked when using my neogaf bookmark, but not when using links within the site to switch forums.

Turns out the forum link URLs now have an ampersand after the question mark, so adding that to the include URL at the top of the script fixed the issue.

I updated the script on Greasyfork with a fix for this.
 

Schrade

Member
0.7.1 seems to have messed up the Filter CP button at the top for me. It worked fine in 0.7.

Pale Moon 26.2.2
GreaseMonkey 1.15.1-signed
 

JeTmAn81

Member
0.7.1 seems to have messed up the Filter CP button at the top for me. It worked fine in 0.7.

Pale Moon 26.2.2
GreaseMonkey 1.15.1-signed

0.7.3 is the latest version, it should update automatically or you can check the GreasyFork link in OP.
 
I have a question, and it is related to this script, but it's not that all related, but I'll ask it here anyway.

I'm trying to implement this script on iOS using 1Blocker's ability to create custom CSS stuff. I know very little, but this is what I've worked out so far...

If I use this as the CSS Selector, it hides the thread just fine.
Code:
.listItem a[href*="1231593"]

However, I have to look up the thread number manually and add it. I don't know how to block by thread titles since things are structured like this:

Code:
<div class="listItem">
    <a class="listItemAnchor" href.... </a>
        <span class="listItemTitle">PoliGaf .....</span>


So, the title of a thread isn't listed except as the text element inside of the span class. Problem is I don't know how to get in there, and all solutions say to use jquery . Is it not possible using just a CSS Selector?
 

Coreda

Member
I have a question, and it is related to this script, but it's not that all related, but I'll ask it here anyway.

I'm trying to implement this script on iOS using 1Blocker's ability to create custom CSS stuff. I know very little, but this is what I've worked out so far...

So, the title of a thread isn't listed except as the text element inside of the span class. Problem is I don't know how to get in there, and all solutions say to use jquery . Is it not possible using just a CSS Selector?

It's not possible to target an element based on its contents with pure CSS unless it contains the same data in an attribute, unfortunately. It would need a unique attribute in the element to be targeted, as you've seen. Luckily all avatars have an alt label with the username so I could create a hide avys userstyle.

However, you could display the thread ID number (in your ex: 1231593) after the the title if that would help by using CSS pseudo elements and a bit of creative cropping. Using the desktop version as an example:

Code:
@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("neogaf.com") {
  
  .threadbit-title::after {
    width: 48px;
    content:attr(id);
    direction: rtl;
    display: inline-block;
    overflow: hidden;
    opacity: 0.5;
    margin: 0 5px;
    vertical-align: middle;
  }

}

=

lHwDccq.png
 
Thanks for the suggestions. Too bad about not being able to do it by words like you set up with your script. But, blocking through thread ID does work pretty well. This is what it looks like on the iPad.

Be0cqRJ.png


The hidden thread is between the NFL and June threads.
 

JeTmAn81

Member
Thanks for the suggestions. Too bad about not being able to do it by words like you set up with your script. But, blocking through thread ID does work pretty well. This is what it looks like on the iPad.

Be0cqRJ.png


The hidden thread is between the NFL and June threads.

Looks cool, better than the nothing that is currently possible on general mobile platforms. At this point I have no idea how to do it other than create my own version of Chrome with extensions enabled. So far the actual makers of Chrome refuse to do that because it's a resource hog. But I can't believe that there isn't some way to just get some simple custom scripting in there.
 
Top Bottom