{"id":13862822,"url":"https://github.com/cute-jumper/emacs-firefox-controller","last_synced_at":"2025-03-21T01:40:10.149Z","repository":{"id":149595345,"uuid":"47784686","full_name":"cute-jumper/emacs-firefox-controller","owner":"cute-jumper","description":"An improved Firefox controller for Emacs","archived":false,"fork":false,"pushed_at":"2016-05-29T00:56:11.000Z","size":962,"stargazers_count":85,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-11-22T23:32:07.485Z","etag":null,"topics":["emacs","firefox"],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cute-jumper.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-12-10T20:07:40.000Z","updated_at":"2024-06-22T01:25:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b9091e1-9337-4c5d-94b3-f2044332d1d8","html_url":"https://github.com/cute-jumper/emacs-firefox-controller","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cute-jumper%2Femacs-firefox-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cute-jumper%2Femacs-firefox-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cute-jumper%2Femacs-firefox-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cute-jumper%2Femacs-firefox-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cute-jumper","download_url":"https://codeload.github.com/cute-jumper/emacs-firefox-controller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244722656,"owners_count":20499151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emacs","firefox"],"created_at":"2024-08-05T06:01:53.374Z","updated_at":"2025-03-21T01:40:10.110Z","avatar_url":"https://github.com/cute-jumper.png","language":"Emacs Lisp","funding_links":[],"categories":["Emacs Lisp"],"sub_categories":[],"readme":"#+TITLE: firefox-controller: An Improved Firefox Controller for Emacs!\n[[http://melpa.org/#/firefox-controller][file:http://melpa.org/packages/firefox-controller-badge.svg]]\n[[http://stable.melpa.org/#/firefox-controller][file:http://stable.melpa.org/packages/firefox-controller-badge.svg]]\n\n* Installation\n** Firefox Extension\n   Install [[https://addons.mozilla.org/en-US/firefox/addon/mozrepl/][MozRepl]] in Firefox.\n** Emacs Extensions\n   This package is now on [[http://melpa.org/][melpa]]. You can install directly from [[http://melpa.org/][melpa]] using\n   =package.el=.\n\n   Or use the following steps to install manually:\n   1. Install [[https://github.com/bard/mozrepl/wiki/Emacs-integration][moz.el]] and [[https://github.com/m2ym/popwin-el][popwin-el]].\n   2. Install this package and add it to your load path\n      : (add-to-list 'load-path \"/path/to/firefox-controller.el\")\n      : (require 'firefox-controller)\n\n* Introduction\nThis project started as a fork of [[https://github.com/RenWenshan][Wenshan]]'s [[https://github.com/RenWenshan/emacs-moz-controller][moz-controller]], but I ended up\nrewriting most of the code and chose a quite different way to use it.\n\nIn =firefox-controller=, we have two different modes:\n1. =firefox-controller-remote-mode=: This is based on the original\n   =moz-controller=, but the number of available commands increases from 11 to\n   more than 30, and simpler key bindings and a better UI are also provided.\n2. =firefox-controller-direct-mode=: In this mode, you can send the keys\n   directly to firefox.\n\n* =firefox-controller-remote-mode=\nUse =M-x firefox-controller-remote-mode= to enter\n=firefox-controller-remote-mode=. It is called =remote-mode= because the keys\nthat you pressed are handled by Emacs and Emacs will send control commands to\nfirefox.\n\nHere is the screeshot when using =firefox-controller-remote-mode=:\n[[./screenshots/remote-mode.png]]\n\nAs we can see in the screenshot, we have defined most of the commonly used\ncommands in firefox. For example, @@html:\u003ckbd\u003e@@n@@html:\u003c/kbd\u003e@@ to scroll down\nby one page, and @@html:\u003ckbd\u003e@@t@@html:\u003c/kbd\u003e@@ to open a new tab and switch to\nit. You can exit the =firefox-controller-remote-mode= by\n@@html:\u003ckbd\u003e@@q@@html:\u003c/kbd\u003e@@.\n\nTo search the web page, press @@html:\u003ckbd\u003e@@s@@html:\u003c/kbd\u003e@@. Here is the\nscreenshot for the search mode in =firefox-controller-remote-mode= (we are\nsearching \"bibtex\" in the current web page): [[./screenshots/search-mode.png]]\n\nHowever, you don't necessarily need to call =firefox-controller-remote-mode= to\nuse these commands. You can bind your own key to a specific command. Look at the\n=firefox-controller--remote-mode-keymap-alist= variable to find out the commands\nthat can be bound to. For example, you can use @@html:\u003ckbd\u003e@@C-c m\nL@@html:\u003c/kbd\u003e@@ to copy the current tab' URL by:\n#+BEGIN_SRC elisp\n(global-set-key (kbd \"C-c m L\")\n                #'firefox-controller-get-current-url)\n#+END_SRC\n\n* =firefox-controller-direct-mode=\nThe limitation of =firefox-controller-remote-mode= is that under that mode, the\nweb page is /non-interactive/. We can only view, scroll, switch tab, search and\nopen another tab for a new URL. However, if you want to jump to a link or enter\nsome text in the input box, these functions are not implemented. Here comes\n=firefox-controller-direct-mode=, which can be combined with some powerful\nfirefox extensions such as [[https://github.com/mooz/keysnail][KeySnail]] to build emacs-like mouseless browsing\nexperience for firefox. We don't have to recreate some firefox extensions in\n=firefox-controller-remote-mode=.\n\nThe use of =firefox-controller-direct-mode= is quite straightforward. =M-x\nfirefox-controller-direct-mode=, then you can use all the key bindings as if you\nare in firefox instead of Emacs, except for four special key bindings:\n1. @@html:\u003ckbd\u003e@@C-M-g@@html:\u003c/kbd\u003e@@: Move the current focus to the content\n   window. This is useful when you want to move out of the address bar or search\n   bar to perform some page navigation(scroll up/down, open some link, etc.).\n2. @@html:\u003ckbd\u003e@@M-g@@html:\u003c/kbd\u003e@@: This is bound to\n   =firefox-controller-highlight-focus=, which can show a temporary background\n   color in the current focused element. This command is useful since the\n   foreground application is Emacs, firefox won't show the current focused\n   element(at least, we can't see it in Plasma 5 in Linux, which is my test\n   environment). You can use @@html:\u003ckbd\u003e@@M-g@@html:\u003c/kbd\u003e@@ to give you a\n   visual hint about the location of the cursor.\n3. @@html:\u003ckbd\u003e@@C-z@@html:\u003c/kbd\u003e@@: This command switches from the current mode\n   to =firefox-controller-remote-mode=.\n4. @@html:\u003ckbd\u003e@@C-g@@html:\u003c/kbd\u003e@@: Exit =firefox-controller-direct-mode=.\n\nHere is the screenshot to use =firefox-controller-direct-mode=:\n[[./screenshots/direct-mode.gif]]\n\nExplanation: After I invoke =firefox-controller-direct-mode=, I type\n@@html:\u003ckbd\u003e@@C-l@@html:\u003c/kbd\u003e@@ to go to the address bar, and use\n@@html:\u003ckbd\u003e@@M-g@@html:\u003c/kbd\u003e@@ to highlight my current location(which is the\naddress bar of course). Then go to google.com, and use\n@@html:\u003ckbd\u003e@@M-g@@html:\u003c/kbd\u003e@@ again to confirm the current focused element in\nfirefox is the search box. After I type and search \"emacs\", I use KeySnail's\nplugin [[https://github.com/mooz/keysnail/raw/master/plugins/hok.ks.js][hok]] to jump to a link and open it.\n\n* Define Your Own Key Sequences to Be Sent\n  You can use =firefox-controller-send-key-sequence= function to define your\n  own key sequences which can be sent directly to firefox.\n\n  For example, we define @@html:\u003ckbd\u003e@@C-c m g@@html:\u003c/kbd\u003e@@ to open a new tab\n  and go to www.google.com:\n  #+BEGIN_SRC elisp\n  (global-set-key (kbd \"C-c m g\")\n                  (lambda ()\n                    (interactive)\n                    (firefox-controller-send-key-sequence\n                     \"C-t C-l www.google.com \u003creturn\u003e\")))\n  #+END_SRC\n\n   Make sure your key sequence can be read by the =kbd= function.\n\n* Customization\n  - =firefox-controller-zoom-step=: Zoom step. Default value is 0.1.\n  - =firefox-controller-highlight-focus-background=: The background color used by\n    =firefox-controller-highlight-focus= command. Default value is \"yellow\".\n\n* Acknowledgment\n  - [[https://github.com/RenWenshan/][RenWenshan]] for the original [[https://github.com/RenWenshan/emacs-moz-controller][moz-controller]].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcute-jumper%2Femacs-firefox-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcute-jumper%2Femacs-firefox-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcute-jumper%2Femacs-firefox-controller/lists"}