0

I happened to discover yesterday that when typing search text in Google that my search history has suddenly stopped showing. I use the https://www.google.com/webhp?complete=0 url to prevent the auto suggestions from appearing. That used to work great, but now Google has done something to prevent that from working.

I use Firefox and have Greasemonkey installed. I have had interest in learning to script in Greasemonkey, and this seems to be an opportune time to start learning. Does anyone have any examples of changing the search input form on Google to a different style so that the search history can be viewed? I've searched around and have found examples of text box modifications, but they don't work with the particular style of input box that Google uses.

TIA,
Brian

Sam DeHaan
  • 10,246
  • 2
  • 40
  • 48
Brian Davis
  • 229
  • 1
  • 12

2 Answers2

1
// ==UserScript==
// @name            re enable autocomplete
// @namespace       http://gcomplete.user.js
// @description     
// @include         htt*://*.google.com/webhp?complete=0
// ==/UserScript==
////////////////////////////////////////////////

    function doIt(){
        document.getElementById("lst-ib").autocomplete = "on";
        window.setTimeout(doIt, 5000);  // wait 5 sec and reapply changes, looped.
    }
    window.setTimeout(doIt, 500);       // wait half a second and apply changes.

this may not be the exact code you need but it should be pretty close.
i chose the loop because i'm lazy and because the textbox seems to be destroyed and recreated at least once.
"lst-ib" is the id of the text box you want, and it has the property 'autocomplete' which google helpfully sets to "off"

RozzA
  • 609
  • 2
  • 9
  • 25
  • Wow! I didn't receive a notification that my question had been answered (4 months ago!), so I apologize for just now replying. I've tried the code that you provided, and it works so long as you click out of the text area and then click back into the text area. I made some mods to your script, and it seems to have fixed the problem - I've placed them in a separate answer here. Thanks for your help on this. Again, my apologies for the extremely late reply. – Brian Davis Aug 24 '12 at 16:44
  • it was a 5 minute answer :P glad it helps, good to see google changed it again after i answered, even better that you fixed it :D – RozzA Sep 03 '12 at 14:45
1

I've tried the code that RozzA provided, and it works so long as you click out of the text area and then click back into the text area. I made the following mods to it, and they seem to have fixed the problem:

function doIt() {
    document.getElementById("lst-ib").autocomplete = "on";
    document.getElementById("lst-ib").blur(); // disable focus
    document.getElementById("lst-ib").focus(); // re-enable focus

    // looping does not seem to be necessary.
    // window.setTimeout(doIt, 5000);
}


window.setTimeout(doIt, 500);       // wait half a second and apply changes.
Community
  • 1
  • 1
Brian Davis
  • 229
  • 1
  • 12