Google's war on usability continues, they are rolling out a new layout that hides the cache links in the results list, showing them in the preview pane. And of course no prefs for this, as also for the preview itself. Here's a modified surrogate that: 1. disables preview, 2. kills the preview UI, 3. unhides the cache links.
For this to work,
you have to disable "Google Instant" in the search prefs, otherwise paging and subsequent searches are done with ajax and the load events don't fire. It's probably possible to make this work with ajax, but I don't want instant so haven't bothered.
Code: Select all
user_pref("noscript.surrogate.google_preview.sources", "@www.google.com/search?");
user_pref("noscript.surrogate.google_preview.replacement", "addEventListener('DOMContentLoaded', function() { Array.forEach(document.getElementsByClassName('vsc'), function(e) { if (e.tagName === 'DIV' && e.hasAttribute('sig')) e.removeAttribute('sig'); }); Array.slice(document.getElementsByClassName('vshid')).forEach(function(e) { if (e.tagName === 'SPAN' && !(e.previousElementSibling && e.previousElementSibling.tagName === 'SPAN' && e.previousElementSibling.classList.contains('gl')) && e.firstElementChild) { e.classList.remove('vshid'); e.classList.add('gl'); e.insertBefore(document.createTextNode(' - '), e.firstElementChild); } }); }, true); addEventListener('load', function() { Array.slice(document.getElementsByClassName('vspib')).forEach(function(e) { e.parentNode.removeChild(e); }); }, false);");