Don't be evil
< Feedback on Better Google (Updated)
So I got some bad news, I don't think I can do anything about this. The exact link doesn't exist anywhere when you're not logged in, so it'd be impossible to fix since there's no information of what the link needs to turn into. I can only hope this remains an issue with people not logged in and nothing further.
Thanks for the quick answer. Hopefully it's some kind of bug on Google's end and it get fixed
Looks like this is not a bug but an intentional change from Google.
https://www.seroundtable.com/google-search-goto-tracking-41957.html
I had assumed it was not a bug, yeah. Again, I can only hope this is something that will only apply to people not logged in. Else, it'll be the end for this script and the other branches like it. At least, I don't believe a way around it could be developed unless if the means to "decrypt" the url is discovered, which I do not have high hopes on.
There's separate userscript and separate Addon - and surely others - that are attempting workarounds. But success depends on how aggressive Google wants to push their change.
Ooh, I was not aware of this. I am surprised the script doesn't already work alongside the one you linked. I'm going to see if I can debug why so that people can have that installed as well as mine to get the intended effect.
Problem I am running into is that the scripts are trying to run at the same time. I made a good temporary fix, but it only will allow the script to work if you actually have the goto links. So don't apply this if you aren't dealing with them. I don't really know what I could check for to only do this if you have the goto links since I'm checking for a modifier that would only exist if the script you linked changed the links.
If anyone has any ideas how to get around this and make it so it works whether you have the goto links or not. let me know as I feel stuck. Either way, turn these lines:
document.querySelectorAll('.MjjYud .yuRUbf').forEach(betterGoogleRow); // .yuRUbf > element inside .MjjYud that holds title of search result and url display link.
prevResultCount = document.querySelectorAll('.MjjYud .yuRUbf').length;
into these lines:
var inter = setInterval(() => {
if (document.querySelector('.MjjYud .yuRUbf').querySelector('a').getAttribute("data-direct-link") == "true") {
clearInterval(inter);
document.querySelectorAll('.MjjYud .yuRUbf').forEach(betterGoogleRow); // .yuRUbf > element inside .MjjYud that holds title of search result and url display link.
prevResultCount = document.querySelectorAll('.MjjYud .yuRUbf').length;
}
}, 20);
For a temporary fix for the time being.
Could you send that temp fix file to me? I tried editing the script with the lines you provided but it's not working for me.
I can't attach files, but here. First, make sure you downloaded the userscript available here. Then, replace the entire runBetterGoogle function (lines 84-97) with this:
var runBetterGoogle = function() {
if (prevResultCount != document.querySelectorAll('.MjjYud .yuRUbf').length) { // .MjjYud > single search result in its entirety.
var inter = setInterval(() => {
if (document.querySelector('.MjjYud .yuRUbf').querySelector('a').getAttribute("data-direct-link") == "true") {
clearInterval(inter);
document.querySelectorAll('.MjjYud .yuRUbf').forEach(betterGoogleRow); // .yuRUbf > element inside .MjjYud that holds title of search result and url display link.
prevResultCount = document.querySelectorAll('.MjjYud .yuRUbf').length;
}
}, 20);
}
if ( !bettered ) {
if ( MutationObserver != undefined ) {
var searchEl = document.getElementById('rcnt'); // #rcnt > element that holds every single element beneath searchbar and search type.
var observer = new MutationObserver(runBetterGoogle);
observer.observe(searchEl, {childList: true, subtree: true});
}
bettered = true;
}
};
Wow it actually worked. Thanks for taking the time to help
I am ashamed I can't come up with a better solution. The main issue is that if my script loads first, it places the wrong url. But even if you change the execution order in Tampermonkey, it still will be inconsistent. I could change the run time, but that means every time you load a page, you'll see the visual swap and that's frankly obnoxious. It turned into me having to create an interval that keeps running until it sees the fixed URLs. Which, again, I can't have a failsafe for if the goto links don't exist, since I can't check if they aren't there, since they aren't supposed to be there anyway due to the other script. I also can't just take the script of the other userscript, it's large and not my work anyway. I'm stumped on what to do.
I thinks this needs an update because the green links no longer show the actual website and instead show a google website. I tested this on Firefox and Chrome
EDIT: This seems to only happen when you're not signed in to your google account