Greasemonkey userscript to hide Google results by domain
-
- 2StarLounger
- Posts: 148
- Joined: 26 Dec 2010, 18:17
Re: Greasemonkey userscript to hide Google results by domain
I posted the script on userscripts.org with screen shots: Google Hit Hider by Domain (Filter out Sites) for Greasemonkey.
Most likely, no one will notice.
Most likely, no one will notice.
-
- GoldLounger
- Posts: 3081
- Joined: 24 Jan 2010, 19:07
Re: Greasemonkey userscript to hide Google results by domain
Thank you! It’s very nice.jscher2000 wrote:Okay, here is an enhanced version. A few things to note:
No problem with old blocked sites; this is testing, so I only had one or two sites; and I don't mind doing a cleanout if needed when testing things like this.
- The button appearance is very nice!
- I like the "temporary" show hit but don't unblock, a refresh later and it's hidden again.
I don't understand the filter on hidey:jscher2000 wrote:There is a button to completely hide hits from blocked domains. (No undo for that yet, you will need to use about:config to switch that back. Filter on hidey and you'll see the preference.)
Yes, there are my hidden items, but the button toggle isn't there. Your button "suppress blocked results" (or similar) worked very well, it's completely removed from the search result. Apparently some of the other scripts out there didn't do the job that nice, there was some white space according to some, but I didn't see that since the only one I tested, see below, didn't work that well.
Ah, wait, you have an entry for the button, found both if I filtered on hider. Moving between .co.uk and .se in different tabs, unblocking in the uk and refreshing in the se, worked very well.
To summarize: 10/10. I think you have at least v1.0 there.
----
Off topic:
One of those you mentioned, “Noise reduction for …â€(nice name as well …), at first seemed OK; got an overlay when I checked if removed any sites etc. Then it became more wonky; sometimes no buttons at all etc. However, I do understand, as you have mentioned earlier, that it isn't the easiest page to write a userscript for; Google uses different things, as the instant search etc. Could be something with that.
I couldn’t get that one to work later on; a click and new search, and it was still there. And the filter overlay didn't show, earlier I got it if I refreshed the page, now nothing.
I assume that the .tld, top-level domain suffix means it's universal, don't have to add ca, .co.uk or .se etc.
By the way, there was an update recently to Greasemonkey, didn't like the new interface so I downgraded to the previous version, also, especially now, when trying different userscript versions.
You do not have the required permissions to view the files attached to this post.
Byelingual When you speak two languages but start losing vocabulary in both of them.
-
- GoldLounger
- Posts: 3081
- Joined: 24 Jan 2010, 19:07
Re: Greasemonkey userscript to hide Google results by domain
Does this mean I have to use that site from now on, to get v0.51.jscher2000 wrote:I posted the script on userscripts.org with screen shots ...
Byelingual When you speak two languages but start losing vocabulary in both of them.
-
- 2StarLounger
- Posts: 148
- Joined: 26 Dec 2010, 18:17
Re: Greasemonkey userscript to hide Google results by domain
Thank you for pointing that out, and for the great review.Argus wrote:Ah, wait, you have an entry for the button, found both if I filtered on hider.
I'll probably double-post here for a while. As you can guess from the version number, nothing much exciting happened in that version compared with v0.5. Actually, I just changed the name a little.Argus wrote:Does this mean I have to use that site from now on, to get v0.51.jscher2000 wrote:I posted the script on userscripts.org with screen shots ...
-
- 2StarLounger
- Posts: 148
- Joined: 26 Dec 2010, 18:17
Re: Greasemonkey userscript to hide Google results by domain
I finally got around to making it easier to unhide the little notices if you want them back. Also adopted the magic .tld extension so that users in other countries should not have to edit the script. I haven't actually tested it widely, so if it doesn't work for you, let me know.
If you are using a version that didn't have "by domain" in the name, this will be considered a new script. Before installing, you may want to save your blocked domain list. One way is to go into about:config, filter using hider, and copy it from there to Notepad or another neutral format. Another way is to display a page of Google results, run this bookmarklet, and copy the list from the dialog to Notepad, etc.:
Then please uninstall the old version before dragging the new .js onto an open Firefox window to install it.
Screen shots here: Google Hit Hider by Domain (Filter / Block Sites) for Greasemonkey (and possibly also future bug fixes).
If you are using a version that didn't have "by domain" in the name, this will be considered a new script. Before installing, you may want to save your blocked domain list. One way is to go into about:config, filter using hider, and copy it from there to Notepad or another neutral format. Another way is to display a page of Google results, run this bookmarklet, and copy the list from the dialog to Notepad, etc.:
Code: Select all
javascript:void(prompt("Block List", document.getElementById("hideyhostlist").textContent));
Screen shots here: Google Hit Hider by Domain (Filter / Block Sites) for Greasemonkey (and possibly also future bug fixes).
You do not have the required permissions to view the files attached to this post.
-
- GoldLounger
- Posts: 3081
- Joined: 24 Jan 2010, 19:07
Re: Greasemonkey userscript to hide Google results by domain
Thank you for the update.
How odd; now it doesn't work on .se. However, it works on co.uk, with or without scripts for Google.
But if I disable JavaScript on google.se I can see the buttons; and also if re-enable JavaScript in the same tab. But then it doesn't work in a new tab with scripts for Google. Tried to add .se; no change.
I must be missing something, it's late. Anti-blocking measures?
How odd; now it doesn't work on .se. However, it works on co.uk, with or without scripts for Google.
But if I disable JavaScript on google.se I can see the buttons; and also if re-enable JavaScript in the same tab. But then it doesn't work in a new tab with scripts for Google. Tried to add .se; no change.
I must be missing something, it's late. Anti-blocking measures?
Byelingual When you speak two languages but start losing vocabulary in both of them.
-
- 2StarLounger
- Posts: 148
- Joined: 26 Dec 2010, 18:17
Re: Greasemonkey userscript to hide Google results by domain
I'm sure Google has its reasons for doing things differently in different countries, but it's a hassle for me.Argus wrote:But if I disable JavaScript on google.se I can see the buttons; and also if re-enable JavaScript in the same tab.
I was trying to monitor events on a smaller part of the document, but I've gone back to monitoring events on the entire body. Also, the presence of <div id="ires"> was inconsistent, so I went back to using <div id="res">. I think this is safe for .com/.co.uk, just a touch less efficient perhaps.
NO, NOT SAFE. ORIGINAL ATTACHMENT DELETED: CRASHES BROWSER IN IMAGE SEARCH
Here is the new version.
You do not have the required permissions to view the files attached to this post.
-
- GoldLounger
- Posts: 3081
- Joined: 24 Jan 2010, 19:07
Re: Greasemonkey userscript to hide Google results by domain
Jefferson,
Thank you for all your work on this. Version 0.64 works OK here now.
I notice that you have changed the "show"-entry slightly; .shownotc; compared to v. 0.51.
A small anomaly, again in the .se TLD; if using the Hide Text button I notice that the UnHide button, top right, is shown above one of the entries there (not in for example .co.uk), when moving between the pages in the search result, clicking on a number or next.
They do line up directly when I select Hide Text, but not on the following pages. Not a problem for me, since I don't use the Sign In links. And also, if I refresh a page they all line up very nice. I understand it's a hassle when it works differently on different top level domains. And I don't know when/if it's going to change over here; so it's possible it will change. I only mention the above to give some feedback. Again, thanks for creating this userscript and making it available to us. By the way, nice bookmarklet up there!
Thank you for all your work on this. Version 0.64 works OK here now.
I notice that you have changed the "show"-entry slightly; .shownotc; compared to v. 0.51.
A small anomaly, again in the .se TLD; if using the Hide Text button I notice that the UnHide button, top right, is shown above one of the entries there (not in for example .co.uk), when moving between the pages in the search result, clicking on a number or next.
They do line up directly when I select Hide Text, but not on the following pages. Not a problem for me, since I don't use the Sign In links. And also, if I refresh a page they all line up very nice. I understand it's a hassle when it works differently on different top level domains. And I don't know when/if it's going to change over here; so it's possible it will change. I only mention the above to give some feedback. Again, thanks for creating this userscript and making it available to us. By the way, nice bookmarklet up there!
You do not have the required permissions to view the files attached to this post.
Byelingual When you speak two languages but start losing vocabulary in both of them.
-
- 2StarLounger
- Posts: 148
- Joined: 26 Dec 2010, 18:17
Re: Greasemonkey userscript to hide Google results by domain
Thank you for the feedback.
It's a long story. When the page reloads using AJAX (without actually navigating to a new page), the script blows away that area. When I re-add the button, I look for that area and if it's not found, I just put the button one line below the top of the page. Apparently one line is not the correct amount to avoid blocking text. What I really need to do is check for when that area comes back and reposition the button inside. At least now I have a site to test on.Argus wrote:A small anomaly, again in the .se TLD; if using the Hide Text button I notice that the UnHide button, top right, is shown above one of the entries there (not in for example .co.uk), when moving between the pages in the search result, clicking on a number or next.
-
- 2StarLounger
- Posts: 148
- Joined: 26 Dec 2010, 18:17
Re: Greasemonkey userscript to hide Google results by domain
Well... here's a new version that fixes the button placement problem. Actually, that button have been moved to a dialog for managing the block list and showing or hiding the little notices. As it's the middle of the night, I can't be sure I've chased down all the newly created bugs, but I thought I would post this here in case anyone wants to take a look. In 24 hours, there's likely to be a tweaked version.
You do not have the required permissions to view the files attached to this post.
-
- GoldLounger
- Posts: 3081
- Joined: 24 Jan 2010, 19:07
Re: Greasemonkey userscript to hide Google results by domain
One word and one word only: cool!jscher2000 wrote:Well... here's a new version that fixes the button placement problem. Actually, that button have been moved to a dialog for managing the block list and showing or hiding the little notices.
This is really cool, and very useful; your "add block list" overlay and "Manage Hiding". Jefferson, you must bump the version number! You’re not fixing bugs; you’re sneaking in new features.
That is: your "UI" for viewing or editing the list as well as individual blocks, since there can be more than one on one search result, is very nice.
By the way; I don't think what I mentioned earlier was limited to the SE TLD; could be the same in, say, Denmark, DK etc. In my part of the world, if using default settings, not changing and saving in cookies, or using a specific Google address; or perhaps using some plugin (there is one "always ".com" - Google.com (in English)", but why I've never bothered to figure out, guess some want it with the search bar or the context menu); you always get redirected to a local version, with a local TLD; guess it's the same for most outside the US. As for instant search, and the redirection, it seems to be the same in all Scandinavian countries, i.e. no instant search at the moment, and I'm sure, some other. I appreciate your work on this part; I mentioned it above, not only for me, but because it might be the same in several other countries.
Other thoughts:
The only thing someone could possibly ask for, I think, and I shouldn't do this since you have been so kind, doing the work and posting your userscript, I agree with what Stuart said earlier; is if it would be possible to use both suppress and block at the same time, somehow.
I understand that that is a different approach, with two lists.
That is: always suppress these , and at the same time block those. If I suppress the view of blocked results it's all or nothing. And that is fine, if one use the list with care; only blocking sites you really don't want in the search result when using “suppress blocked itemsâ€.
Some sites are so awful, in one way or another, that I would never like to see them, then suppress is good, but when filtering search results the ability to unblock some sites are also useful.
It’s just a thought when looking at it. As it is, it works very well, and I have no problem with this, since I usually don't run rampant and add lots of things in different settings just because it's possible. The blocked results are already "dimmed", so it looks very good. And I also like, when possible, a minimalistic design, small foot print etc. So. I'm not sure how much value and usefulness that would add to the script, and if it would be used.
Byelingual When you speak two languages but start losing vocabulary in both of them.
-
- 2StarLounger
- Posts: 148
- Joined: 26 Dec 2010, 18:17
Re: Greasemonkey userscript to hide Google results by domain
I see what you mean. I don't think it would be that hard to add an additional level of blocking. Not sure what to call it, but the idea being you would never see those hits ever, and you couldn't accidentally revive them from the manage panel. Maybe a "curse" button?Argus wrote:... I agree with what Stuart said earlier; is if it would be possible to use both suppress and block at the same time, somehow.
I understand that that is a different approach, with two lists.
That is: always suppress these , and at the same time block those. If I suppress the view of blocked results it's all or nothing. And that is fine, if one use the list with care; only blocking sites you really don't want in the search result when using “suppress blocked itemsâ€.
Some sites are so awful, in one way or another, that I would never like to see them, then suppress is good, but when filtering search results the ability to unblock some sites are also useful.
Edit: Probably Perma-ban would make a better name for a button. Or a user-configurable four letter word.
-
- 2StarLounger
- Posts: 148
- Joined: 26 Dec 2010, 18:17
Re: Greasemonkey userscript to hide Google results by domain
Here is version 0.73, which is the last in the sequence for the previous design.
OLD LIST STYLE [/i]
With that out of the way...
Here is a take on permanent banning, new in version 0.81. If you click a hit notice, there is a new red button captioned "Perma-ban". These domains don't have hit notices and they don't appear in the management pane. They are just gone.
It also has two other new (or new-ish) features:
A few final known bugs before going 1.0 relate to the temporary "Show Hit" feature: those results lack logical controls and sometimes get illogical ones. I also noticed the management pane sometimes gets huge fonts, so I'll try to override Google's styles without ruining the user's ability to use zoom.
OLD LIST STYLE [/i]
With that out of the way...
Here is a take on permanent banning, new in version 0.81. If you click a hit notice, there is a new red button captioned "Perma-ban". These domains don't have hit notices and they don't appear in the management pane. They are just gone.
It also has two other new (or new-ish) features:
- Button captions are stored as an array of strings in a preference so you could change Perma-ban (sounds like an underarm deodorant) to S@#%can if you like; and
- The manage pane is persistent, that is, if it was displayed the last time you used Google, it is opened automatically the next time. To defeat #2, change the preference named "greasemonkey.scriptvals.JeffersonScher/Google Hit Hider by Domain.mngpaneopen" from "Y-N" or "Y-Y" to "N-N". Or just close it when you're done.
You do not have the required permissions to view the files attached to this post.
Last edited by jscher2000 on 05 Feb 2011, 17:17, edited 1 time in total.
-
- PlatinumLounger
- Posts: 5685
- Joined: 24 Jan 2010, 19:16
- Location: Cape Cod, Massachusetts,USA
Re: Greasemonkey userscript to hide Google results by domain
I guess I lost the entire gist of this thread. Lengthy replies and all.
Simply put, just what is Greasemonkey and what does it do for me or anyone in particular?
Just haven't been able to follow the posts. Am I the only one?
Simply put, just what is Greasemonkey and what does it do for me or anyone in particular?
Just haven't been able to follow the posts. Am I the only one?
BOB
______________________________________
If I agreed with you we'd both be wrong.
______________________________________
If I agreed with you we'd both be wrong.
-
- Administrator
- Posts: 12623
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Greasemonkey userscript to hide Google results by domain
Bob,
I too am a bit of a neophyte here, but Greasemonkey appears to be a Firefox addon that allows people to write scripts that modify web pages on the fly. This script of Jefferson's does a great job of removing sites you don't want from Google searches.
I too am a bit of a neophyte here, but Greasemonkey appears to be a Firefox addon that allows people to write scripts that modify web pages on the fly. This script of Jefferson's does a great job of removing sites you don't want from Google searches.
StuartR
-
- 2StarLounger
- Posts: 148
- Joined: 26 Dec 2010, 18:17
Re: Greasemonkey userscript to hide Google results by domain
If you have the Greasemonkey extension, then you can write or download userscripts. They are not as powerful as full-blown browser add-ons, but you can tweak them yourself if you know or learn some JavaScript.viking33 wrote:Simply put, just what is Greasemonkey and what does it do for me or anyone in particular?
You can check out my two "public" scripts on the userscripts.org site (http://userscripts.org/users/JeffersonScher) but there are thousands available. Like any other repository mixing partially and fully and poorly baked software, user discretion is very much advised!
Edit: I should add that in nearly all cases, the purpose of userscripts is to improve the experience of using a site. There are some designed to harvest information, spam the site, or defeat its security measures. One must choose not to be evil.
-
- 5StarLounger
- Posts: 1102
- Joined: 21 Jan 2011, 16:51
- Location: Florida
Re: Greasemonkey userscript to hide Google results by domain
Could these user scripts be made compatible with Chrome?
PJ in (usually sunny) FL
-
- 2StarLounger
- Posts: 148
- Joined: 26 Dec 2010, 18:17
Re: Greasemonkey userscript to hide Google results by domain
I've read that the Greasemonkey extension for Chrome does not implement the methods used to store the list and preferences. That may have changed, but I haven't researched it. (I haven't installed Chrome yet, so the motivation is not as strong...)PJ_in_FL wrote:Could these user scripts be made compatible with Chrome?
-
- 2StarLounger
- Posts: 148
- Joined: 26 Dec 2010, 18:17
Re: Greasemonkey userscript to hide Google results by domain
Latest version posted on userscripts.org: http://userscripts.org/scripts/show/95205" onclick="window.open(this.href);return false;
Version 0.93 incorporates some user suggestions, including having Perma-ban available when you first block a site, and being able to hide the Manage Hiding button for those who don't want to give up the screen real estate to display it. It also lets you more easily change the captions on many of the buttons if you like. I think I'll stop updating this thread now. It's getting too long for anyone to read it.
Version 0.93 incorporates some user suggestions, including having Perma-ban available when you first block a site, and being able to hide the Manage Hiding button for those who don't want to give up the screen real estate to display it. It also lets you more easily change the captions on many of the buttons if you like. I think I'll stop updating this thread now. It's getting too long for anyone to read it.
-
- Administrator
- Posts: 12623
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Greasemonkey userscript to hide Google results by domain
Jefferson,
Please do let us know when you post updates on the userscripts.org web site, as that is not a site that many of us frequent.
I installed version 0.93, and it completely failed to function. No buttons, no nothing. I deinstalled it and reinstalled version 0.81 and this works fine.
Please do let us know when you post updates on the userscripts.org web site, as that is not a site that many of us frequent.
I installed version 0.93, and it completely failed to function. No buttons, no nothing. I deinstalled it and reinstalled version 0.81 and this works fine.
StuartR