Closed Procyon-b closed 5 years ago
Thank you very much, I wasn't aware of that situation with the tbs parameter, thanks for picking up on that. And yes, you're right, I completely forgot to push the updates here - these changes look great, please feel free to submit a PR whenever you'd like.
Thanks again!
Just a quick update @Procyon-b - I've updated the repo with the latest version, so feel free to submit your changes
I was off kb friday and almost all saturday, but I'm glad that this gave you the time to update the repository.
A PR has been submitted. :)
I've just discovered your extension, and immediately thought of using it as a userscript in tampermonkey. Just as I do for make-gis-great-again.
In the process of adapting your code, I have found a couple bugs. One that was already corrected in the extension but not here, as I have noticed after downloading the extension.
replace("tbs=isz:i",
doesn't catch all the possibilities. If the user selects another criterion, they are all in the tbs parameter. I've fixed the regular expression to handle this. I have also simplified the use of temporary variables in "addSizes()".I have added code to checkmark the current value if it is one of the added options.
The code also removes the checkmark from the "any size" default, and adds back a link.
The current value is also displayed as the menu header. One caveat is that the style is only set when another criterion is selected (google does not insert the css when one of your value is selected)
the code to find "isz_i" is not from your current version. It's what I've written before noticing that this repository doesn't have the latest version. My version stops attempting the find the toolbar after 10 seconds (100 attempts), in case google changes the layout again and the classname is modified.
I'll propose PR when you are ready. One final change that I will suggest: rename run.js to run.user.js to help users link directly from here (using the "raw" button) to load in tampermonkey.