Skip to content

Instantly share code, notes, and snippets.

@bentruyman
Created July 19, 2011 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bentruyman/1093511 to your computer and use it in GitHub Desktop.
Save bentruyman/1093511 to your computer and use it in GitHub Desktop.
Resizes tab characters to 2 spaces (currently only works in FF4 and Opera 10.60)
// ==UserScript==
// @match http://*/*
// @match https://*/*
// ==/UserScript==
var style = document.createElement('style');
style.textContent = [
'pre { ',
' -webkit-tab-size: 2;',
' -moz-tab-size: 2;',
' -o-tab-size: 2;',
' tab-size: 2;',
'} '
].join('');
document.getElementsByTagName('head')[0].appendChild(style);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment