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

Question/comment

§
Posted:

help for my mod or perhaps also a feature request ? :-)

Hi spmbt,

I use your great script for very long time but a little bit moddified. But after update of Firefox to version 66 my mod doesen't work anymore and I am wondering why...

I don't needed the site search as it is. More click-/chooseable keywords like -pinterest -books.google.de -amazon.de par example or other searchterms

so I simply changed in line 387

site:{url:'site:'+ S.sites[0], txt:$L['search in']+' '+ S.sites[0], one:'day'} //you may comment this line to site:{url:''+ S.sites[0], txt:$L['search in']+' '+ S.sites[0], one:'day'} //you may comment this line

and line 431

: 'site:'+ (t && (t.getAttribute('site')|| t.parentNode && t.parentNode.getAttribute('site'))||'')); to : ''+ (t && (t.getAttribute('site')|| t.parentNode && t.parentNode.getAttribute('site'))||''));

this mod worked for years and versions(yours or mozillas) for me but now the page refreshes and no searchterms is added to the google search field

could you help me or explain what is going on here?

I have both older firefox 65.0.2 and 66.0.3 installed and they handle it differently. I read somewhere that Mozilla integrated an own userscript extension .. disabled it in newer version but same problem.

by the way it would be nice to see this in your versions... I mean the site option with its presets could be switched as I do with the ability to use more searchterms like -+""~ / site: / related: / intitle: or whatever as presets

I have no coding skills but was very happy to simple delete site: of your code on the right line :-)

have a nice evening greatings and thanks for your script and time doll

spmbtAuthor
§
Posted:
Edited:

Hi! In the line 567 code is written: if(pdf || /site/.test(itrv))... If you remove text 'site' before this listener of click, in variable itrv word 'site' it not matched and string for search is not modified.

The simplest way to save functionality is to change word 'site:' to ',,, ' (with space), for example.

Change line 567 to

if(pdf || /site|,,, /.test(itrv))

and in lines 387 and 431 change word 'site:' to ',,, ' (with space on the end).

There is second function for word 'site': if it present, next search removes old keyword (site name) in the search string by code in the line 429. If you want remove your old keyword automatically, you must update regexp in this line: in addition to word 'site' remove rest of search string if it contain ',,, '. Line 429 will be contain:

.replace(/( site(:|%3A)\s*\S*| ,,, \s*\S*|$)/ig, /Srch|site/.test(i)?'':'$1')

Post reply

Sign in to post a reply.