firefox configuration

Table of Contents

1. plugins

1.1. spantree for gitlab, octotree for github

1.2. stylus

1.3. sidebery

1.4. uBlock Origin

1.5. surfingkeys

https://gist.githubusercontent.com/xandeer/6e956dc9e44e0688caf4bd58e72f6c3f/raw/50b774cfe9935887ef044f0112faf309f0646cda/surfingkeys.js

api.map('J', 'D');
api.map('K', 'S');
api.map('t', 'T');
api.map('F', 'af');
api.map('h', 'E');
api.map('l', 'R');
api.map('j', 'd');
api.map('k', 'e');

settings.focusFirstCandidate = true;
settings.tabsThreshold = 0;

api.addSearchAlias('c', 'grep.app', 'https://grep.app/search?q=', 's', 'https://grep.app/search?q=', function(response) {
    var res = JSON.parse(response.text);
    return res.map(function(r){
        return r.phrase;
    });
});
api.mapkey('oc', 'grep.app', function() {
    api.Front.openOmnibar({type: "SearchEngine", extra: "c"});
});
api.addSearchAlias('w', 'wikipedia en', 'https://en.wikipedia.org/wiki/', 's', 'https://en.wikipedia.org/w/api.php?action=opensearch&format=json&formatversion=2&namespace=0&limit=40&search=', function(response) {
    return JSON.parse(response.text)[1];
});
api.addSearchAlias('f', 'wikipedia cn', 'https://zh.wikipedia.org/wiki/', 's', 'https://en.wikipedia.org/w/api.php?action=opensearch&format=json&formatversion=2&namespace=0&limit=40&search=', function(response) {
    return JSON.parse(response.text)[1];
});
api.mapkey('ow', 'wikipedia en', function() {
    Front.openOmnibar({type: "SearchEngine", extra: "w"});
});
api.mapkey('of', 'wikipedia cn', function() {
    Front.openOmnibar({type: "SearchEngine", extra: "f"});
});
api.map('oo', 'og');
api.mapkey('ou', 'github', function() {
    Front.openOmnibar({type: "SearchEngine", extra: "h"});
});
api.mapkey('oa', 'Open google translate to cn', () => {
    tabOpenLink("https://translate.google.com/?sl=auto&tl=zh-CN&text=")
});
api.mapkey('ob', 'Open google translate to en', () => {
    tabOpenLink("https://translate.google.com/?sl=auto&tl=en&text=")
});

// theme
settings.theme = `
.sk_theme {
  background: #100a14dd;
  color: #4f97d7;
}
.sk_theme tbody {
  color: #292d;
}
.sk_theme input {
  color: #d9dce0;
}
.sk_theme .url {
  color: #2d9574;
}
.sk_theme .annotation {
  color: #a31db1;
}
.sk_theme .omnibar_highlight {
  color: #333;
  background: #ffff00aa;
}
.sk_theme #sk_omnibarSearchResult ul>li:nth-child(odd) {
  background: #5d4d7a55;
}
.sk_theme #sk_omnibarSearchResult ul>li.focused {
  background: #5d4d7aaa;
}
.sk_theme #sk_omnibarSearchResult .omnibar_folder {
  color: #a31db1;
}
.sk_theme #sk_hints > div {
    color: white !important;
}
`;

2. hide tabbar

(browse-url-firefox "about:config")

toolkit.legacyUserProfileCustomizations.stylesheets –> true browser.tabs.drawInTitlebar –> true

modify userChrome.css

(browse-url-firefox "about:profiles")

/Users/kevin/Library/Application Support/Firefox/Profiles

${FIREFOXPROFILE}/chrome/userChrome.css

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);

#sidebar-header {
    display: none;
}

#TabsToolbar {
    visibility: collapse !important;
}
#TabsToolbar .tabbrowser-tab {
    display: none !important;
}

#nav-bar[inFullscreen],
#TabsToolbar[inFullscreen] {
    display: none;
}

#TabsToolbar > .titlebar-buttonbox-container {
    display: none !important;
}

3. disable update

(browse-url-firefox "about:config")
  1. search app.update
  2. boolean to false
  3. interval to 999999999

4. refs