Google Search Extra Buttons

Add buttons (past 1/2/3 days, weeks, PDF search etc.) for Google search page

< Feedback on Google Search Extra Buttons

Review: Good - script works

§
Posted:
Edited:

Is it possible to change the location of the extra buttons?

I've tried to find it myself in the script, but my lack of knowledge made me fail miserably.

Is it possible to change the location of the extra buttons next to the google search field like in this pic?

Thank you for this great and good working script by the way, my hat off to you! :smiley:

spmbtAuthor
§
Posted:

In the latest version 35.2018.12.5 vertical position of buttons determined in the text "top:startPg ?'40px':'33px'" (line 398) by change '33px' to 15. If you need shift to right, change "{right: -a+33+'px'}" (line 387) to "{right: -a-213+'px'}".

§
Posted:

I managed to change it thanks to your help, it looks amazing! 👍

One more question. I'll never use the first 4 buttons, is there an easy way to remove them if permitted at all?

All I actually need is the hour/day/month/week/year -part..

Cпасибо, брат! :wink:

spmbtAuthor
§
Posted:

The easiest way is to hide them by display: none by counter ii of its generation(for loop (var i in buttS) in line 382).

Add in line 398

cs: $x({position:'absolute', top:startPg ?'40px':'33px',wordSpacing:'-1px'}

pair display: ii<3?'none':'block' , as here

cs: $x({position:'absolute', top:startPg ?'40px':'33px',wordSpacing:'-1px', display: ii < 3 ?'none':'block'}

(But it will hide "Settings" button. Write fixed settings to code directly in lines around 584-590.)

§
Posted:
Edited:

Thanks again brother, I really appreciate this a lot! :)

I replaced the following code in version 35.2018.12.5 :

in line 387 {right: -a+33+'px'} replaced with {right: -a-70+'px'}

in line 398 cs: $x({position:'absolute', top:startPg ?'40px':'33px',wordSpacing:'-1px'} replaced with cs: $x({position:'absolute', top:startPg ?'40px':'15px',wordSpacing:'-1px', display: ii < 3 ?'none':'block'}

spmbtAuthor
§
Posted:
Edited:

Thank you for this ideas ) and code for other users!

I create new version 35.2018.12.6 and add variable setts.hiddenEdgeLeft =0 (your value is 3) for support hiding buttons from left edge (it need hard written to code, not saved in localStorage).

§
Posted:

You are the real MVP! 😎

§
Posted:
Edited:

~~Hi there. Great script! I was looking to do the exact thing JM1970 wanted to, but the lines to change are absent in the current version of the script. How can I move the button bar in the same manner? Thanks!~~ Nevermind, I've figured it out, it's the lines 405 and 416 in case anyone needs to do the same.

spmbtAuthor
§
Posted:

Yes, its are placed here.

§
Posted:

Yes, I've figured. I've also managed to reorder time intervals, putting "hours" first. How can I have each interval resetting back to the default state after each search? I mean I don't want to keep seeing "3 hours" or "7 days" until I change the interval again just because that's what I've searched last. Thanks!

spmbtAuthor
§
Posted:
Edited:

In this script is no function for reset, but it might be simple. If JS erases data in localStorage, all settings in next pages or after reset (Ctrl-F5) are default. But settings are placed not in Google domain, its placed in https://spmbt.github.io/ (because Google erases all localStorage periodically).

So, if you open page https://spmbt.github.io/googleSearchExtraButtons/saveYourLocalStorage.html , then press F12 (or Ctrl(Cmd)-Shift-I) and type in Console line "localStorage"+Enter, you can see key googXButtons_sett with sring like "{\"lang\":\"en\",\"lastHoursLess\":true,\"design1612\":false,\"whiteMintOval\":false,\"dwmyh\":[4,2,1,1,1]}". "dwmyh" ARE SETTINGS FOR days, weks, etc. If you erase all this string (command localStorage.clear() in this window, in this domain spmbt.github.io) or if you change value to \"dwmyh\":[1,1,1,1,1], browser saves default values for all next pages in google.com in this browser.

In the userscript there is function for change values also. Execute saveLocStor('','','remove') in userscript (on the new button), then storage in spmbt.github.io will resetted. (It call xLocStor(), whish send message to iframe with domain spmbt.github.io, then function of userscript in that domain receives message and erases that localstorage by command 'remove'.) You may clone my latest script in Github.com. But I don't think this function and button would be interesting for many users.

Post reply

Sign in to post a reply.