Skip to content

Instantly share code, notes, and snippets.

@Glench
Last active August 29, 2015 14:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Glench/69ed436e29e1efeaa547 to your computer and use it in GitHub Desktop.
Save Glench/69ed436e29e1efeaa547 to your computer and use it in GitHub Desktop.
allows you to change google's autocomplete to whatever you want >:) type into google to create an autocomplete list, then activate this bookmarklet
javascript:(function()%7Bfunction%20callback()%7B(function(%24)%7Bvar%20jQuery%3D%24%3Bfunction%20omgwtfval(term)%20%7Breturn%20'%3Cli%20class%3D%22sbsb_c%20gsfs%22%20dir%3D%22ltr%22%20style%3D%22text-align%3A%20left%3B%22%3E%20%3Cdiv%20role%3D%22option%22%3E%20%3Cdiv%20class%3D%22sbqs_c%22%3E'%20%2B%20term%20%2B%20'%3C%2Fdiv%3E%20%3C%2Fdiv%3E%20%3C%2Fli%3E'%3B%7D%3Bfunction%20omgwtf(val)%20%7B%24('ul.sbsb_b%20li').remove()%3Bvar%20terms%20%3D%20val.split('%5Cn')%3Bterms.forEach(function(term)%20%7B%24('ul.sbsb_b').append(omgwtfval(term))%3B%7D)%3B%7D%3B%24('body').prepend(%24('textarea').attr('id'%2C%20'omgwtf').css(%7Bposition%3A%20'absolute'%2C%20right%3A%2020%2C%20top%3A%2020%2C%20width%3A%20300%2C%20height%3A%20400%2C%20zIndex%3A%201000000%2C%20display%3A%20'block'%7D))%3B%24('%23omgwtf').on('input%20propertychange'%2C%20function()%20%7Bomgwtf(this.value)%3B%24('.mw%2C%20%23footcnt%2C%20%23main').remove()%3B%7D)%7D)(jQuery.noConflict(true))%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.7.1%2Fjquery.min.js%22%3Bif(s.addEventListener)%7Bs.addEventListener(%22load%22%2Ccallback%2Cfalse)%7Delse%20if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()
function omgwtfval(term) {
return '<li class="sbsb_c gsfs" dir="ltr" style="text-align: left;"> <div role="option"> <div class="sbqs_c">' + term + '</div> </div> </li>';
};
function omgwtf(val) {
$('ul.sbsb_b li').remove();
var terms = val.split('\n');
terms.forEach(function(term) {
$('ul.sbsb_b').append(omgwtfval(term));
});
};
$('body').prepend($('textarea').attr('id', 'omgwtf').css({position: 'absolute', right: 20, top: 20, width: 300, height: 400, zIndex: 1000000, display: 'block'}));
$('#omgwtf').on('input propertychange', function() {
omgwtf(this.value);
$('.mw, #footcnt, #main').remove();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment