Index

Table of contents

Firefox

cli

open url
firefox [url]
new window
firefox -new-window [url]?
firefox -new-instance [url]?
open firefox and lookup term using default search engine
firefox -search [term]

settings

open config panel
about:config
disable crash recovery annoyance
browser.sessionstore.resume_from_crash=false
disable notifications annoyance
dom.webnotifications.enabled=false

profile

bookmarks and sites visited
places.sqlite
preferences
prefs.js
documentation
https://support.mozilla.org/en-US/kb/recovering-important-data-from-an-old-profile

keyboard shortcuts

zoom
ctrl +     zoom in
ctrl -     zoom out
ctrl 0     reset
inspect
ctrl shift i
javascript console
ctrl shift k
script to create a text area with button for testing javascript on page
var script = document.createElement("script");
script.src = 'https://code.jquery.com/jquery-3.6.0.min.js';
document.head.appendChild(script);

var area = document.createElement('textarea');
document.body.appendChild(area);

var input = document.createElement('input');
input.value = 'submit';
input.type = 'submit';
input.onclick = function() {
    var value = area.value;
    eval(value);
}
document.body.appendChild(input);

plugin development

hello world

minimal manifest.json
{
  "manifest_version": 2,
  "name": "my-plugin-name",
  "version": "1.0",
  "content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": ["script.js"]
    }
  ]
}
script.js
document.body.style.border = "5px solid red";
running the plugin
about:debugging

manifest

add a description (optional)
"description": "bla bla bla",
add icons (optional)
"icons": {
  "48": "icons/myicon-48.png",
  "96": "icons/myicon-96.png"
}
match patterns
<all_urls>             match all urls
*://*/*                Match all HTTP, HTTPS and WebSocket URLs.
*://*.mozilla.org/*    Match all HTTP, HTTPS and WebSocket URLs that are hosted at "mozilla.org" or one of its subdomains.
*://mozilla.org/       Match all HTTP, HTTPS and WebSocket URLs that are hosted at exactly "mozilla.org/".
ftp://mozilla.org/     Match only "ftp://mozilla.org/".
https://*/path         Match HTTPS URLs on any host, whose path is "path".
https://*/path/        Match HTTPS URLs on any host, whose path is "path/" and which has no URL query string.
https://mozilla.org/*  Match HTTPS URLs only at "mozilla.org", with any URL path and URL query string.
file:///blah/*         Match any FILE URL whose path begins with "blah".
documentation
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Anatomy_of_a_WebExtension