Skip to content

Commit

Permalink
Added command "focus to the content". Closes #23.
Browse files Browse the repository at this point in the history
  • Loading branch information
mooz committed Jun 30, 2010
1 parent 4e277d5 commit be46540
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
7 changes: 6 additions & 1 deletion locale/en-US/functions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,9 @@ restart_firefox=Restart Firefox
command_interpreter=Command interpreter

ext_select=List exts and execute selected one
list_command=List and execute commands
list_command=List and execute commands

## =========================================================================== ##

focus_to_prompt=Focus to the KeySnail's prompt
focus_to_content=Focus to the content
7 changes: 6 additions & 1 deletion locale/ja/functions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,9 @@ restart_firefox=Firefox を再起動
command_interpreter=JavaScript のコードを評価

ext_select=エクステ一覧表示
list_command=コマンドの実行
list_command=コマンドの実行

## =========================================================================== ##

focus_to_prompt=KeySnail のプロンプトへフォーカス
focus_to_content=コンテンツへフォーカス
7 changes: 7 additions & 0 deletions share/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ var ksBuiltin = {
categoryFocus: {
__mode__: 0,

focus_to_content: [
function (ev, arg) {
let (elem = document.commandDispatcher.focusedElement) elem && elem.blur();
gBrowser.focus();
content.focus();
}, true],

focus_to_the_location_bar: [
function (ev) {
command.focusToById("urlbar");
Expand Down

0 comments on commit be46540

Please sign in to comment.