Skip to content

Instantly share code, notes, and snippets.

@bo33b
Last active September 4, 2015 16:00
Show Gist options
  • Save bo33b/41365a417f7fdf842f4d to your computer and use it in GitHub Desktop.
Save bo33b/41365a417f7fdf842f4d to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Google Dictionary
// @namespace bo33b
// @description Clean Google Dictionary
// @downloadURL https://gist.github.com/bo33b/41365a417f7fdf842f4d/raw/dictionary.user.js
// @version 5.1.1
// @include https://www.google.com/search?q=define+*
// @grant none
// ==/UserScript==
/***bookmarklet:
javascript:void(open(`https://www.google.com/search?q=define+${getSelection()}&tbs=qdr:s#uid_0`,``,`width=580,height=550,top=100,left=${screen.availWidth/2-290},scrollbars=1`));
*/
function gebi(id) { return document.getElementById(id); }
document.body.style.overflowX = 'hidden'; //no horizontal scroll
for (var div of document.querySelectorAll('.xpdxpnd')) div.style.maxHeight = 'none'; //expand divs
[
gebi('top_nav'), //service chooser
gebi('appbar'), //results stats
gebi('uid_0').childNodes[1], //expand box
gebi('bottomads'), //ads
document.querySelector('.srg'), //search results
gebi('extrares'), //related searches
gebi('foot'), //page numbers
gebi('footcnt'), //page footer
].forEach(function (cV,i,a) {if(cV) cV.outerHTML=''});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment