Created
January 27, 2009 10:19
-
-
Save satyr/53269 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name autoContentFocus | |
| // @namespace http://d.hatena.ne.jp/murky-satyr | |
| // @description Focuses the content whenever a tab is selected. | |
| // @include main | |
| // @compatibility Fx 3.0.* | |
| // @version 2010-04-02 | |
| // ==/UserScript== | |
| setTimeout(function(){ | |
| gBrowser.tabContainer.addEventListener('TabSelect', function(e){ | |
| var b = gBrowser.selectedTab.linkedBrowser; | |
| setTimeout(function acf(){ | |
| var w = b.contentWindow; | |
| if(!w) return; | |
| w.focus(); | |
| var e = document.commandDispatcher.focusedElement; | |
| if(e && /^(?:embed|object)$/i.test(e.nodeName)) e.blur(); | |
| }); | |
| // might as well... | |
| gPrefService.setBoolPref('accessibility.browsewithcaret', false); | |
| }, false); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment