jscher2000 Author



Where did you want your search terms to be highlighted:

  • search results page?
  • Google's cached copy of the page?
  • actual page when you follow a link to that result?

I updated the script to handle this. It works for me, hopefully it works for you! Thank you for bringing it to my attention.


This is caused by turning on one of the site's features: "Automatic highlighting: When results are clicked, highlight the search terms on the page"

That changes the URL of the result, so I'll need to write special logic to extract the true site address:

NORMAL:

<a 
href="https://www.jeffersonscher.com/gm/google-hit-hider/" 
id="title_1" 
name="title_1" 
onmouseover="window.status='https://www.jeffersonscher.com/gm/google-hit-hider/'; return true;" 
onmouseout="ws('');" 
onclick="tc(this);changeIxquickStarRatingImage(1,1,'#763B75','s/white/graphics/star_purple_fade.gif');return openResult('https://www.jeffersonscher.com/gm/google-hit-hider/', 'https://www.jeffersonscher.com/gm/google-hit-hider/', '');">
<span style="text-decoration: none;" class="result_url_heading">Google Hit Hider by Domain — Author's Site - jeffersonscher.com</span>
</a>

PROXIED:

<a 
href="https://ixquick-proxy.com/do/spg/highlight.pl?ah=1&l=english&cat=web&c=hf&q=%22google+hit+hider%22&rl=NONE&u=https:%2F%2Fwww.jeffersonscher.com%2Fgm%2Fgoogle-hit-hider%2F&rid=LFLOQRLMPLLK478GTYHSU&hlq=https%3A%2F%2Fstartpage.com%2Fdo%2Fsearch&mtcmd=process_search&mtlanguage=english&mtqid=LFLOQRLMPLLK478GTYHSU&mtrcount=&mtrl=NONE&mtabp=-1&mtt=air&mtcat=web&mtstartat=0&mtnj=0" 
id="title_1" 
name="title_1" 
target="_blank" 
onmouseover="window.status='https://www.jeffersonscher.com/gm/google-hit-hider/'; return true;" 
onmouseout="ws('');" 
onclick="tc(this);changeIxquickStarRatingImage(1,1,'#763B75','s/white/graphics/star_purple_fade.gif');return openResult('https://www.jeffersonscher.com/gm/google-hit-hider/', 'https://ixquick-proxy.com/do/spg/highlight.pl?ah=1&l=english&cat=web&c=hf&q=%22google+hit+hider%22&rl=NONE&u=https:%2F%2Fwww.jeffersonscher.com%2Fgm%2Fgoogle-hit-hider%2F&rid=LFLOQRLMPLLK478GTYHSU&hlq=https%3A%2F%2Fstartpage.com%2Fdo%2Fsearch&mtcmd=process_search&mtlanguage=english&mtqid=LFLOQRLMPLLK478GTYHSU&mtrcount=&mtrl=NONE&mtabp=-1&mtt=air&mtcat=web&mtstartat=0&mtnj=0', '_blank');">
<span style="text-decoration: none;" class="result_url_heading">Google Hit Hider by Domain — Author's Site - jeffersonscher.com</span>
</a>

Re: @stoptheads:
Is it just me on a Sunday morning or is the site in German?

There are lots of scripts for cleaning URLs for Google and other sites. One of those might be convenient to adapt.



Re: @chacham:
I don't understand your question:

Why does the script not us the default parameter?

Those lines try to retrieve a username value the user previously saved in GM storage. If the parameter comes back with a text value, that's fine, but if it comes back null/undefined, a blank string is assigned. If I don't do this, when I try do to anything with uname I may get an error or strange results.


Re: @chacham:
I don't use that site, so I'm probably not the right person to work on this.

By "right end of the tab line" do you mean in the page? If this is a feature added by an extension to the toolbar area, then a userscript isn't going to be able to touch that area.

Generally speaking, there are two ways to save data locally:

(1) Greasemonkey storage. The GM_setValue and GM_getValue are the functions you need. This is script-specific but cross-domain. https://wiki.greasespot.net/GM_setValue https://wiki.greasespot.net/GM_getValue For example: https://openuserjs.org/scripts/jscher2000/oujs_Forum_-_My_Scripts_Filter/source

(2) DOM storage (AKA local storage). This is domain-specific, but accessible to any scripts that run on the site and to the site itself. It can be wiped by the site or by DOM storage data cleaners, so possibly a bit fragile. I rarely use this, but for example: http://userscripts-mirror.org/scripts/review/96765


Re: @Marti:
That looks good, and the clipboard is convenient. I wonder whether it might need a caption to explain what it's for?

As for whether to serve scripts without @updateURL, I think you can decide later whether that is a permanent policy or just for the duration of the current troubles.


I'm not sure how much trouble it would be, but to minimize potential errors, what do you think about adding a "Required Metadata" heading to the Author Tools section, along with a computed line such as:

document.write("// @updateURL " + window.location.href.replace("scripts", "meta")+".meta.js");

(I don't know what the server-side code would be, so...)





Thank you for the report and apologies for the delayed reply.

I don't know why google.co.za works differently than other multi-level TLDs. I suggest adding a "user include" on the Tampermonkey dashboard as a workaround.

Open the dashboard, click the script name, then click the Settings tab. You will see a box listing the standard included domains and below that, an empty box labeled "User includes". Click the "Add..." button below that box and paste:

https://www.google.co.za/*

and Okay that. Then reload your search results page and the block buttons should appear.




Re: @EvaparotangCote:

Something like this maybe?

var t = document.title;
if (t) if (t.length > 20 && document.body.firstChild.nodeName == "IMG"){
  var start = document.title.indexOf("Image, ");
  var end = document.title.indexOf(" pixels)");
  if (start > -1 && end > -1){
    document.title = document.title.substr(start+7, end - (start + 7)) + " - " + document.title.substr(0, start-1) + ")";
  }
}



I'm not completely clear on what the action item is at this point. I viewed the source and clicked Submit and now the script information page has the contents of the header. The rest of it needed a minor edit to catch up the change log. I can repeat if needed, but do I really need to download the source for possible future uploading?


Re: @chacham:
Hi chacham, could you give the link of the nonworking results page?

If the nonworking page is on www.google.com: Could you post the "modified" HTML source of the whole results area below the navigation buttons? The easiest way (in Firefox) is to select all by pressing Ctrl+a, then right-click > View Selection Source. In the source viewer, it should be tightly packed HTML and style rules that go on forever. Use Find (Ctrl+f) to look for this:

id="ires"

Then select from the http://pastebin.com/ (no registration required), save the page, and post the new link back here. Then I can see whether Google is serving you something with a different structure.


Also, a user reported to me that https://addons.mozilla.org/firefox/addon/google-search-link-fix/ partially breaks the script. If you use that extension, you might have that issue, too.


Re: @Marti:
Hi Marti, I think 90% of the duplicate requests occur with Chrome+Tampermonkey and not Firefox+Greasemonkey (which you previously commented on in a thread on us.o). So please don't take my note as a criticism of this site!


Re: @jscher2000:
Updated stats:

1/1/2014-3/31/2014: estimated 7,642 new and upgrade installations
4/1/2014-6/30/2014: estimated 3,400 new and upgrade installations
7/1/2014-9/30/2014: estimated 3,619 new and upgrade installations
10/1/2014-12/31/2014: estimated 3,422 new and upgrade installations

(To try to avoid counting duplicates, additional installations during the same quarter from the same IP address of the same version on the same browser brand are ignored. I cannot identify unique users or browsers so this is simply an estimate.)


Re: @ngudger2021:
Maybe something along these lines:

var blurred = document.querySelectorAll('img[src*="~"]'); // tilde anywhere in file name or path for (var counter=0; counter<blurred.length; counter++){ var badname = blurred[counter].src; var goodname=badname.substr(0, badname.indexOf("~")) + badname.substr(badname.lastIndexOf(".")); blurred[counter].src=goodname; }