Firefox: Difference between revisions

From miki
Jump to navigation Jump to search
 
(25 intermediate revisions by the same user not shown)
Line 9: Line 9:
| {{kb|Alt-Shift}}
| {{kb|Alt-Shift}}
|Access key. Eg. {{kb|Alt-Shift-F}} to go to search box in MediaWiki
|Access key. Eg. {{kb|Alt-Shift-F}} to go to search box in MediaWiki
|-
| {{kb|Ctrl-Shift-C}}
|Open console and debugger tools.
|}
|}


Line 20: Line 23:
:* https://addons.mozilla.org/en-US/firefox/addon/unloadtab/
:* https://addons.mozilla.org/en-US/firefox/addon/unloadtab/
:* https://addons.mozilla.org/en-us/firefox/addon/auto-unload-tab/
:* https://addons.mozilla.org/en-us/firefox/addon/auto-unload-tab/
* Suggested by [https://blog.mozilla.org/firefox/firefox-extensions-work-from-home/ Mozilla]
:* [https://addons.mozilla.org/en-US/firefox/addon/tabby-window-tab-manager/?src=external-blog-productivity-extensions Tabby]
:* [https://addons.mozilla.org/en-US/firefox/addon/simple-tab-groups/?src=external-blog-productivity-extensions Simple Tab Group]
:* [https://blog.mozilla.org/firefox/nine-tips-for-better-tab-management/ other tips for better tabs management]

=== textern ===
[https://addons.mozilla.org/en-US/firefox/addon/textern/ Textern] allows for using any external editor to edit editbox...

;Installation
* Install the plugin
* Download and install the native app:
<source lang="bash">
git clone --recurse-submodules https://github.com/jlebon/textern
cd textern
sudo make native-install LIBDIR=/usr/lib
</source>
* NEW Configuration:
:* External editor: <code>["ngvim", "-f", "+sil! call cursor(%l,%c)"]</code>
:* Shortcut: {{kb|Ctrl+I}}
:* Extenstion: {{file|.txt}}
:* This reuses configuration we used on pentadactyl. Windows geometry works better, but still sluggish feeling in nvim.

* OLD Configuration:
:* External editor: <code>["gnome-terminal", "--geometry=118x62+0+0", "--wait", "--", "nvim", "+call cursor(%l,%c)"]</code>
:* Shortcut: {{kb|Ctrl+I}}
:* Extenstion: {{file|.txt}}
:* {{red|'''Issue''': This doesn't work great. First window geometry detection is always fucked up and we need to resize the window or nvim display is fucked up. Second, nvim feels sluggish}}
* In Vim mediawiki plugin, adapt the ftdetect line:
<source lang="vim">
au BufRead,BufNewFile *%2Fmediawiki%2Findex.php* set filetype=mediawiki
</source>

=== tridactyl ===
[https://github.com/cmcaine/tridactyl Tridactyl] is the new extension similar to pentadactyl but working with recent Firefox.

;Install
* Run <code>:nativeinstall</code>, and run the pasted command in a shell to download the native extension.
* Set the editor:
set editorcmd /usr/bin/terminator -m --p nvim -i /usr/local/icons/neovim.png -u -T "$PWD" -x env COLORTERM=gnome-terminal nvim %f '+normal!%lGzv%c|'
* Set start page:
set newtab about:home

;Install native on offline Windows (for Vim edition)
* Download .xpi file.
* Install XPI and run <code>:installnative</code> on a Windows machine connected to Internet.
* Export registry key at <code>HKCU:\SOFTWARE\Mozilla\NativeMessagingHosts\tridactyl</code> to a file.
* Copy that file and content of {{file|%userprofile%/.tridactyl}} to offline pc.
* Install .xpi on offline PC, and run reg file.

;troubleshooting
* tridactyl eating new tab page
:* We can set <code>newtab</code> (eg. set it to <code>about:home</code>), but then Ctrl-T opens a tridactyl page, and the home page, which is annoying. Also it breaks {{kb|Ctrl-T Ctrl-L}} workflow.
:* Instead, we don't set newtab, and rely on the bookmark toolbar to contain our favorite home pages.
* Find next not working
:* Use {{kb|Ctrl-G}}. [https://github.com/tridactyl/tridactyl/issues/64]


=== pentadactyl ===
=== pentadactyl ===
;{{red|DISCONTINUATED}}
* Pentadactyl '''no longer works''' since Firefox 57.
* To keep using pentadactyl, use Firefox 56 (debian package available [http://cz.archive.ubuntu.com/ubuntu/pool/main/f/firefox/firefox_56.0+build6-0ubuntu0.16.04.2_amd64.deb here]).
* For firefox 57+, consider using [https://github.com/cmcaine/tridactyl tridactyl].


'''pentadactyl''' is an add-on that turns Firefox into a powerful vim-like browser.
'''pentadactyl''' is an add-on that turns Firefox into a powerful vim-like browser.
;Repositories
;Repositories
Line 27: Line 91:
* [https://github.com/5digits/dactyl on GitHub] Original repository, but inactive sinch March 2017 (Up to Firefox 53.x)
* [https://github.com/5digits/dactyl on GitHub] Original repository, but inactive sinch March 2017 (Up to Firefox 53.x)
: http://5digits.org/nightlies Nightly build.
: http://5digits.org/nightlies Nightly build.

;Configuration
* See file {{file|~/.pentadactylrc}}
<source lang="vim">
"1.2pre

loadplugins '\.(js|penta)$'
group user
map -count -description='Next tab' -modes=n,v <C-j> -builtin <count><C-n>
map -count -description='Previous tab' -modes=n,v <C-k> -builtin <count><C-p>
set cdpath=''
set editor='ngvim -f +<line> +"sil! call cursor(0, <column>)" <file>'

" vim: set ft=pentadactyl:
</source>


;Installation from source (on Firefox 48)
;Installation from source (on Firefox 48)
Line 49: Line 128:
;Usage
;Usage
* See <code>:help</code> for quick help
* See <code>:help</code> for quick help
* {{kbkey|^i}} uses vim/nvim for editbox (external editor).
* {{kbkey|^t}} uses built-in vim for editbox.
* {{kbkey|f}} show hints and follow a link.
* {{kbkey|f}} show hints and follow a link.
* {{kbkey|y}} current location.
* {{kbkey|y}} current location.
Line 75: Line 156:
Use ''auto-commands'' to make Pentadactyl alway pass all of your keys through for a particular URL [http://octalzeroes.com/2014/03/19/pentadactyl-and-pass-through.html]:
Use ''auto-commands'' to make Pentadactyl alway pass all of your keys through for a particular URL [http://octalzeroes.com/2014/03/19/pentadactyl-and-pass-through.html]:
:autocmd LocationChange 'https://cloud.digitalocean.com/droplet/console/*' :normal! <C-z>
:autocmd LocationChange 'https://cloud.digitalocean.com/droplet/console/*' :normal! <C-z>

;Troubleshooting
* <code>Error ...: options is undefined</code>, usually when entering some commands, like {{kb|gg}} or {{kb|G}}.
: '''Workaround''' &mdash; just enter and leave command mode ({{kb|:}} then {{kb|Esc}}).


=== [https://addons.mozilla.org/en-US/firefox/addon/tab-groups-panorama/ Tab Groups] ===
=== [https://addons.mozilla.org/en-US/firefox/addon/tab-groups-panorama/ Tab Groups] ===
Excellent extension for managing tabs.
Excellent extension for managing tabs.

=== [https://addons.mozilla.org/en-US/firefox/addon/video-downloadhelper/?src=search Video DownloadHelper] ===
The best video downloader on Firefox.
* Slower but better download success rate than other extensions (for instance, works on RTBF Auvio, especially combined with AdBlock Plus).
* Can convert on-the-fly.
* Requires local companion application installation.

[https://addons.mozilla.org/en-US/firefox/addon/video-downloadhelper/?src=search AdBlock Plus] recommended to skip initial video ad.

=== [https://addons.mozilla.org/en-US/firefox/addon/video-downloadhelper/?src=search AdBlock Plus] ===
Excellent to skip video ad.

== More extensions ==
More extensions to consider installing:
* https://addons.mozilla.org/en-US/firefox/addon/textern/
* [https://github.com/GhostText/GhostText GhostText]
* [https://addons.mozilla.org/en-US/firefox/addon/edit-with-emacs1/ edit-with-emacs]


== Tips ==
== Tips ==
Line 86: Line 188:
* [https://addons.mozilla.org/en-US/firefox/addon/tab-groups-panorama/ Tab Groups]
* [https://addons.mozilla.org/en-US/firefox/addon/tab-groups-panorama/ Tab Groups]
* [https://addons.mozilla.org/en-US/firefox/addon/onetab/ OneTab]
* [https://addons.mozilla.org/en-US/firefox/addon/onetab/ OneTab]

=== Disable Firefox update ===
Recent FF doesn't allow disabling update, and keeps nagging you about update, even though your PC is offline and never connected to Internet.

To disable [https://support.mozilla.org/en-US/questions/1251629]:
* Create a folder to store the policy file.
:* On Linux, create a folder {{file|/etc/firefox/policies}} (system-wide) or a folder {{file|/usr/bin/distribution}} (where {{file|/usr/bin}} is the installation directory of firefox).
:* On Win10, create a folder {{file|distribution}} where Firefox EXE is located (typically {{file|C:\Program Files\Mozilla Firefox\distribution}}).
* In that folder, create a file {{file|policies.json}} (see available [https://github.com/mozilla/policy-templates/blob/master/README.md policy template]):
<source lang="json">
{
"policies": {
"DisableAppUpdate": true
}
}
</source>

=== Suspend background tabs ===
Recent FF have an option that unload tabs if memory is low. It is disabled by default because it unloads tab even if memory threshold is not reached.
<source lang="bash">
browser.tabs.unloadOnLowMemory True
</source>
Possibly, tab unloading can be monitored at <code>about:unloads</code> [https://support.mozilla.org/en-US/kb/unload-inactive-tabs-save-system-memory-firefox].

Extensions:
* [https://addons.mozilla.org/en-US/firefox/addon/new-tab-suspender/ Tab Suspender Firefox] ([https://github.com/pradeep-mishra/tab_suspender_firefox github])
* [https://addons.mozilla.org/en-US/firefox/addon/auto-tab-discard/ Auto Tab Discard]

=== Ignore / pass-through mode ===
* Press {{kb|Shift-Ins}} to toggle '''ignore''' mode (similar to pentadactyl pass-through mode {{kb|Ctrl-Z}}).
:Remember, on some laptop {{kb|Ins}} is not available, but must access with {{kb|Fn-E}} key, so this gives {{kb|Fn-Shift-E}}.

Latest revision as of 16:21, 21 June 2022

Configuration

  • Last visited tab with Ctrl-Tab — Go to about:config, and set browser.ctrlTab.previews to true [1].

Keyboard shortcuts

Alt-Shift Access key. Eg. Alt-Shift-F to go to search box in MediaWiki
Ctrl-Shift-C Open console and debugger tools.

Extensions

Candidates

Extension I might install in the future:

  • Extension to suspend tabs. ! Careful, this may lead to loss of work if you typed text in a form and the page gets suspended

textern

Textern allows for using any external editor to edit editbox...

Installation
  • Install the plugin
  • Download and install the native app:
git clone --recurse-submodules https://github.com/jlebon/textern
cd textern
sudo make native-install LIBDIR=/usr/lib
  • NEW Configuration:
  • External editor: ["ngvim", "-f", "+sil! call cursor(%l,%c)"]
  • Shortcut: Ctrl+I
  • Extenstion: .txt
  • This reuses configuration we used on pentadactyl. Windows geometry works better, but still sluggish feeling in nvim.
  • OLD Configuration:
  • External editor: ["gnome-terminal", "--geometry=118x62+0+0", "--wait", "--", "nvim", "+call cursor(%l,%c)"]
  • Shortcut: Ctrl+I
  • Extenstion: .txt
  • Issue: This doesn't work great. First window geometry detection is always fucked up and we need to resize the window or nvim display is fucked up. Second, nvim feels sluggish
  • In Vim mediawiki plugin, adapt the ftdetect line:
au BufRead,BufNewFile *%2Fmediawiki%2Findex.php* set filetype=mediawiki

tridactyl

Tridactyl is the new extension similar to pentadactyl but working with recent Firefox.

Install
  • Run :nativeinstall, and run the pasted command in a shell to download the native extension.
  • Set the editor:
set editorcmd /usr/bin/terminator -m --p nvim -i /usr/local/icons/neovim.png -u -T "$PWD" -x env COLORTERM=gnome-terminal nvim %f '+normal!%lGzv%c|'
  • Set start page:
set newtab about:home
Install native on offline Windows (for Vim edition)
  • Download .xpi file.
  • Install XPI and run :installnative on a Windows machine connected to Internet.
  • Export registry key at HKCU:\SOFTWARE\Mozilla\NativeMessagingHosts\tridactyl to a file.
  • Copy that file and content of %userprofile%/.tridactyl to offline pc.
  • Install .xpi on offline PC, and run reg file.
troubleshooting
  • tridactyl eating new tab page
  • We can set newtab (eg. set it to about:home), but then Ctrl-T opens a tridactyl page, and the home page, which is annoying. Also it breaks Ctrl-T Ctrl-L workflow.
  • Instead, we don't set newtab, and rely on the bookmark toolbar to contain our favorite home pages.
  • Find next not working
  • Use Ctrl-G. [2]

pentadactyl

DISCONTINUATED
  • Pentadactyl no longer works since Firefox 57.
  • To keep using pentadactyl, use Firefox 56 (debian package available here).
  • For firefox 57+, consider using tridactyl.


pentadactyl is an add-on that turns Firefox into a powerful vim-like browser.

Repositories
http://5digits.org/nightlies Nightly build.
Configuration
  • See file ~/.pentadactylrc
"1.2pre

loadplugins '\.(js|penta)$'
group user
map -count -description='Next tab' -modes=n,v <C-j> -builtin <count><C-n>
map -count -description='Previous tab' -modes=n,v <C-k> -builtin <count><C-p>
set cdpath=''
set editor='ngvim -f +<line> +"sil! call cursor(0, <column>)" <file>'

" vim: set ft=pentadactyl:
Installation from source (on Firefox 48)
git clone https://github.com/5digits/dactyl.git
  • Make project
cd dactyl/
make -C pentadactyl xpi
  • Then in Firefox, go to add-on tab, and select install .xpi from file located in dactyl/downloads.
Installation
  • First disable add-on signature policy. Go to [about:config] and set xpinstall.signatures.required to false.
  • Download the latest nightly build and install it
I installed pentadactyl-20160121.xpi on Firefox 44.
  • Restore add-on signature policy
Usage
  • See :help for quick help
  • ^i uses vim/nvim for editbox (external editor).
  • ^t uses built-in vim for editbox.
  • f show hints and follow a link.
  • y current location.
  • p paste new location.
  • H L history back/forward.
  • ^n ^p next / previous tab.
  • ^v — Enable passthrough (next) (only next key press)
Tip: To paste text, press ^v twice.
  • ^z — Enable passthrough
  • :mkp to save current configuration
  • To print:
ha[rdcopy][!] to print a given page.
:ha[rdcopy][!] >{filename} to print to a file.
:dialog printpreview to display the print preview dialog.
:dialog printsetup to display the print setup dialog.
Customization

I prefer to use ^j ^k to go to next/previous tab, like I do to navigate between buffers.

:map -builtin -description "Next tab" <C-j> <C-n>
:map -builtin -description "Previous tab" <C-k> <C-p>
:mkp
Configure passthrough

Configure passkeys to tell Pentadactyl what keys must be passed through (k)

:set passkeys+=gabrielecirulli.github.io/2048/:<Up><Down><Left><Right>

Use auto-commands to make Pentadactyl alway pass all of your keys through for a particular URL [3]:

:autocmd LocationChange 'https://cloud.digitalocean.com/droplet/console/*' :normal! <C-z>
Troubleshooting
  • Error ...: options is undefined, usually when entering some commands, like gg or G.
Workaround — just enter and leave command mode (: then Esc).

Tab Groups

Excellent extension for managing tabs.

Video DownloadHelper

The best video downloader on Firefox.

  • Slower but better download success rate than other extensions (for instance, works on RTBF Auvio, especially combined with AdBlock Plus).
  • Can convert on-the-fly.
  • Requires local companion application installation.

AdBlock Plus recommended to skip initial video ad.

AdBlock Plus

Excellent to skip video ad.

More extensions

More extensions to consider installing:

Tips

Tab management

See Mozilla — Tab groups removal.

Interesting extensions:

Disable Firefox update

Recent FF doesn't allow disabling update, and keeps nagging you about update, even though your PC is offline and never connected to Internet.

To disable [4]:

  • Create a folder to store the policy file.
  • On Linux, create a folder /etc/firefox/policies (system-wide) or a folder /usr/bin/distribution (where /usr/bin is the installation directory of firefox).
  • On Win10, create a folder distribution where Firefox EXE is located (typically C:\Program Files\Mozilla Firefox\distribution).
  • In that folder, create a file policies.json (see available policy template):
{
    "policies": {
        "DisableAppUpdate": true
    }
}

Suspend background tabs

Recent FF have an option that unload tabs if memory is low. It is disabled by default because it unloads tab even if memory threshold is not reached.

browser.tabs.unloadOnLowMemory   True

Possibly, tab unloading can be monitored at about:unloads [5].

Extensions:

Ignore / pass-through mode

  • Press Shift-Ins to toggle ignore mode (similar to pentadactyl pass-through mode Ctrl-Z).
Remember, on some laptop Ins is not available, but must access with Fn-E key, so this gives Fn-Shift-E.