make-gis-great-again
make-gis-great-again copied to clipboard
Here is a working version of the script
[edit added 2020/01/22] To install the lastest version of the script, check the current version number in this repository, below in this thread, and in my fork. Use the method in this comment to install/update the userscript. When installed that way, it will be updated automatically every time the source is updated.
[Original message] For some time now I have been using your script as a userscript in tampermonkey. I had it modified in two places:
- It gets the language info from the page itself, not anymore from the browser (only as a last resort). It prevents a mixture of languages (my chrome is in english, but the page is in FR or EN).
- I add a link "Search by image" at the top of the text block (like in another extension IIRC)
- I have also added other languages. But not always for both the button and the link. I don't recall the exact source of this. Maybe requests here or on the webstore page.
At the time, I was planning to PR the new code here, but I got focused on other projects.
I did not notice immediately the effect of the new CSS ; in incognito mode the old style is still in use, and the script still works. The code below can handle the old and the new style.
I can PR it if you want. And post explanation on the modications.
// @version 1.5.0.2
use latest version below
I have since cleared my google cookies and local storage, something I do very regularly, and I can't get google to use the new interface at all. If someone has a trick to trigger the new style... Before that I had the new style in only one of the 4 google.tld I use.
For the new layout this actually pulls the link for the first related image, and not the selected image.
OK, I see why. The script takes the image url from the first "related image". In the old layout, this image was the focused image. In the new layout, the focused image doesn't appear in the related list.
IIRC the reason for getting the url from the thumbnail was that it was the only place where the image real url was present. Looking at the code I see that this is not the case anymore (in the new layout). I have modified the script to get the image url from the main display.
Since december, the script has been modified. The icon in the "View image" button has been removed, and a second @include rule has been added to match that particular type of page (when you click one of the "related" thumbnails to open in a new tab).
...
// @version 1.5.0.3
...
user newer version below
And here is a version with the "Search by image" link fixed in the new layout. It is placed just above the "Related images" block, and opens a tab with a new search using the displayed image.
// @version 1.5.0.4
use latest version below
I got it working, but I had to use what was between the "// ==UserScript==" in your first post and then use the code from the last post. If I just copy+pasted the entire script in the last post it would give me an error.
My bad, The missing line was pasted correctly, but somehow github's syntax hides it when it is on the same line as the "code" markup. I'm editing the post to correct this.
Can this code not be upstreamed to the extension?
New version with a fix for image without "related images".
You can test the difference by using this search: image search "tree" This should focus on an image without a "view image" button in the previous version (1.5.0.4) of the script, and with the button in the new version.
// @version 1.5.0.6
use latest version below
@Quenz , an extension can't be updated this way. At least not for userscripts anyway and not if the extension is not designed to allow this. We will have to wait for @devunt to publish a new version in the web store.
And another bug fixed for the "search by image" added link.
// @version 1.5.0.7
use latest version below
@Procyon-b can you make pr for this?
@procyon-b have you noticed that it usually doesn't always show the main image when you click view image, sometimes it shows the first "related image" instead when clicking view image
@thinkpad4: I know that it was a problem when this layout first appeared (to me, at least) several weeks ago. @JohnEdwa noticed it and warned me. I was not aware that it still happens. When you encounter this problem again can you post the full url of the search?
@Procyon-b it seems to happen more consistently when choosing larger images: https://www.google.com/search?q=taylor+swift&tbm=isch&source=lnt&tbs=isz:lt,islt:40mp&sa=X&ved=0ahUKEwjP57GZz5DkAhVnUd8KHU8YCI4QpwUIJA&biw=1920&bih=924&dpr=1#imgrc=uVE2nCgWs4oVUM:
If you look at the first image of Taylor and try and view it you'll see it will open the first shown in the related images. Using Larger than size 40 MP it seems to happen with every image, it picks the first related image instead.
@thinkpad4 : I see what is happening. I have modified the script to try to get the image url from another place in the page. This new logic can break previous behavior of the script. For those who heavily rely on this to get/view images from google search, please try this version and use it intensively. Report any problem.
Clicking on a "related image" might not always get you the full size image when clicking its "view image" button. But it's probably site specific.
As usual some sites will redirect direct access to their images: facebook.
// @version 1.5.0.8
use latest version below
@Procyon-b I've tested it for a bit and it's getting all the correct images and in the correct sizes, I will keep testing but first impression it works. Thank you very much
based on @devunt profile, the last activity is from 15 july 2019, i hope this can be merged asap so updating it will be easier
If there is no more bug found with v1.5.0.8 , I'll update (in a couple days) my PR #90 with this code.
@Procyon-b how about forking the repo so us fans can Star and Watch properly?
@thapar I have forked it 3 weeks ago when I prepared the PR of the new version. So far issues are not enabled (you have to come here).
I'm trying to contact @devunt by email to ask him to publish a new version of the extension. I hope he receives my message.
For the time being, those who want to have the script automatically updated from my fork can use the "Raw" button on the script page. Tampermonkey detects that it is a userscript, and proposes to install it. And it will automatically be updated when a newer version appears.
I have merged #90. Sorry for the delays.
Great ! :)
@thapar I have forked it 3 weeks ago when I prepared the PR of the new version. So far issues are not enabled (you have to come here).
I'm trying to contact @devunt by email to ask him to publish a new version of the extension. I hope he receives my message.
For the time being, those who want to have the script automatically updated from my fork can use the "Raw" button on the script page. Tampermonkey detects that it is a userscript, and proposes to install it. And it will automatically be updated when a newer version appears.
So is this still the latest version availible? And is it supposed to work? Cause I don't see any change with this script enabled or disabled :(
@psonnosp yes, it is the latest version. But the extension has not been updated yet. I don't know if @devunt has forgotten. If you want to use the userscript you have to load it in tampermonkey.
Another reason for the script not to work is google protecting the page. I have seen that from time to time, only when I reset the cookies, and usually only when the page is displayed the first time. But it can stay protected if you're logged into google. To confirm if this is the case, open the javascript console (F12 or Ctrl+Shift+I ). In the "Console" tab, do you see this ?
If yes, delete all google cookies, Reload the page and verify if it works. And if you want to log in, only do that after testing to see if it changes the behavior.
Last remark. Are you by any chance using the co.nz TLD ? I have only recently noticed that tampermonkey has a bug and doesn't recognize this as a valid domain. A bug report has been filed and it will be fixed in the next version.
Didn't know there was an extension so the script is what I'm already using. I get no error, or text whatsoever, in the console so that's not it and I'm trying this on .com. But I tried to logout and clean cookies anyway just in case but no change. Does it require a newish version of FF? Cause I'm on an old one since I want to keep using some addons that didn't transfer to the newer versions..
How old is your FF ? I haven't used it for years, so I don't know if there is a big difference with chrome. But since you don't see any error message, it means that the script is not stopped by an error. What extension are you using to run the script? (I assumed it was tampermonkey on chrome or FF)
I'm on the last usable version of FF, 56.0.2 with TM. Never had any problems with a script running on it before so don't think it's the reason but since it's supposed to to work and it doesn't I just threw it out there. I've tried disabling other add-ons and scripts too but no difference.
I have grabbed a copy of FF and will try debugging the script (just curious :) ).
@psonnosp I have tried with FF 56.0.2 and I don't have any problem with the userscript. As you can see in the screenshot below.
OK, guess something is f-ed up at my end then :( Thanks for sorting that out.