Skip to content

Commit

Permalink
3.2.1 - general updates, add new search extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
aminomancer committed Dec 4, 2022
1 parent 34c7f51 commit 158fec4
Show file tree
Hide file tree
Showing 28 changed files with 487 additions and 444 deletions.
26 changes: 16 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ module.exports = {
parser: "@babel/eslint-parser",
parserOptions: {
sourceType: "script",
babelOptions: {
configFile: path.join(__dirname, ".babel-eslint.rc.js"),
},
babelOptions: { configFile: path.join(__dirname, ".babel-eslint.rc.js") },
},
env: {
node: false,
Expand All @@ -29,9 +27,7 @@ module.exports = {
// "mozilla/sjs": true,
// "mozilla/xpcshell": true,
},
settings: {
"import/extensions": [".mjs"],
},
settings: { "import/extensions": [".mjs"] },
rules: {
"arrow-body-style": "off",
complexity: ["warn", { max: 50 }],
Expand Down Expand Up @@ -65,15 +61,25 @@ module.exports = {
globals: { XPCNativeWrapper: true },
rules: { complexity: "off", "no-console": "off" },
},
{
files: ["resources/aboutconfig/**"],
rules: { "prettier/prettier": "off" },
},
{
files: ["prefs/**"],
rules: { "prettier/prettier": "off" },
globals: { user_pref: "readonly" },
},
{
files: ["resources/script-override/**"],
rules: { "prettier/prettier": ["error", { quoteProps: "preserve" }] },
},
{
// All .eslintrc.js files are in the node environment, so turn that
// on here.
// https://github.com/eslint/eslint/issues/13008
files: [".eslintrc.js"],
env: {
node: true,
browser: false,
},
env: { node: true, browser: false },
},
{
files: ["*.mjs"],
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
prefs/*.js
resources/aboutconfig/*
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"trailingComma": "es5",
"useTabs": false,
"overrides": [
{ "files": [".prettierrc"], "options": { "parser": "json" } },
{ "files": ["*.css", "*.scss", "*.md"], "options": { "printWidth": 1000 } }
]
}
21 changes: 11 additions & 10 deletions JS/osDetector.uc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name OS Detector
// @version 1.3.2
// @version 1.3.3
// @author aminomancer
// @homepage https://github.com/aminomancer/uc.css.js
// @description Set an attribute "operatingsystem" on the root element of the
Expand All @@ -14,14 +14,15 @@
// ==/UserScript==

(function() {
if (!ChromeUtils) return;
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"
);
if (AppConstants) {
document.documentElement.setAttribute(
"operatingsystem",
AppConstants.platform
try {
const { AppConstants } = ChromeUtils.importESModule(
"resource://gre/modules/AppConstants.sys.mjs"
);
}
if (AppConstants) {
document.documentElement.setAttribute(
"operatingsystem",
AppConstants.platform
);
}
} catch (error) {}
})();
4 changes: 2 additions & 2 deletions JS/urlbarMods.uc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Urlbar Mods
// @version 1.7.4
// @version 1.7.5
// @author aminomancer
// @homepage https://github.com/aminomancer/uc.css.js
// @description Make some minor modifications to the urlbar. See the code
Expand Down Expand Up @@ -605,7 +605,6 @@ class UrlbarMods {
).properties.clientType = {
type: "string",
};
var limbo = ChromeUtils.import("resource:///modules/UrlbarView.sys.mjs");
let src1 = RemoteTabs.startQuery.toSource();
let src2 = gURLBar.view._updateRow?.toSource();
let src3 = TabToSearch.startQuery.toSource();
Expand Down Expand Up @@ -737,6 +736,7 @@ class UrlbarMods {
if (!sortSrc.includes(`UrlbarPrefs.get("showSearchSuggestionsFirst")`)) {
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
QuickSuggest: "resource:///modules/QuickSuggest.sys.mjs",
UrlbarPrefs: "resource:///modules/UrlbarPrefs.sys.mjs",
UrlbarProviderQuickSuggest:
"resource:///modules/UrlbarProviderQuickSuggest.sys.mjs",
Expand Down
32 changes: 5 additions & 27 deletions JS/userChromeDevtoolsSheetLoader.uc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Browser Toolbox Stylesheet Loader
// @version 2.1.1
// @version 2.1.2
// @author aminomancer
// @homepage https://github.com/aminomancer
// @description Load userChrome and userContent stylesheets into Browser Toolbox windows
Expand Down Expand Up @@ -49,20 +49,10 @@ let EXPORTED_SYMBOLS = [];
let sss = win.Cc["@mozilla.org/content/style-sheet-service;1"].getService(
win.Ci.nsIStyleSheetService
);
try {
sss.loadAndRegisterSheet(
win.Services.io.newURI(path + name),
sss[type]
);
} catch (e) {}
}
unloadSheet(win, path, name, type) {
let sss = win.Cc["@mozilla.org/content/style-sheet-service;1"].getService(
win.Ci.nsIStyleSheetService
);
try {
sss.unegisterSheet(win.Services.io.newURI(path + name), sss[type]);
} catch (e) {}
let uri = win.Services.io.newURI(path + name);
if (!sss.sheetRegistered(uri, sss[type])) {
sss.loadAndRegisterSheet(uri, sss[type]);
}
}
observe(sub) {
if (this.lastSubject === sub) return;
Expand All @@ -74,9 +64,6 @@ let EXPORTED_SYMBOLS = [];
case "DOMContentLoaded":
this._onContentLoaded(e);
break;
case "uninit":
this._onWindowUninit(e);
break;
}
}
_onContentLoaded(e) {
Expand All @@ -87,15 +74,6 @@ let EXPORTED_SYMBOLS = [];
const path = this.getChromePath(win);
this.loadSheet(win, path, "userChrome.css", "AUTHOR_SHEET");
this.loadSheet(win, path, "userContent.css", "USER_SHEET");
win.addEventListener("uninit", this);
}
_onWindowUninit(e) {
let win = e.target;
if (!this.isDevtools(win)) return;
const path = this.getChromePath(win);
this.unloadSheet(win, path, "userChrome.css", "AUTHOR_SHEET");
this.unloadSheet(win, path, "userContent.css", "USER_SHEET");
win.removeEventListener("uninit", this);
}
}

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ The `userContent.css` file handles stuff like the devtools, some UI pages and co

So `userContent.css` isn't strictly required for the rest of the theme to work, but without it you'll find some elements look inconsistent with the theme, and it also takes care of some issues that make the fabled global dark mode harder to realize. If you already have a `userContent` file, I'd suggest changing its name to `custom-content.css` and placing it in the [resources/in-content](/resources/in-content) folder. The theme doesn't include this file, since it's purely intended for end-user modifications, but it automatically loads the file if it exists. It loads last and therefore wins any conflicts of equal priority & specificity. You can also delete any of the [content stylesheets](/resources/in-content) you don't want to use, or remove their `@import` rules from userContent.css.

I've bundled some of my addons in this repo as well. They are in the [extensions](extensions) folder. My custom new tab page is signed (it's a modded fork of [Tab Notes][] by wildsky) but you will still need to "install addon from file" in `about:addons` since you're not downloading the extension package from a Mozilla domain. There are several search engine addons in the [extensions/search-extensions](extensions/search-extensions) folder. These simply add one-off search engines for websites like Google Images or YouTube, and some include search suggestions/autocomplete. Firefox already comes with Amazon and Wikipedia addons, but they have ugly icons and unnecessarily long labels. Mine are simply called Amazon and Wikipedia, and have icons that match the theme. Some of Firefox's built-in search engines also lack search suggestions even though the websites can provide suggestions. Some are signed and hosted on AMO, but others remain unsigned due to [an AMO bug][]. You can download the following search engines from AMO: [YouTube][]; [Google Translate][]; [Firefox Add-ons][]; [Searchfox][searchfox engine]; [Bugzilla][]; [MDN Web Docs][]; [Library Genesis][].
I've bundled some of my addons in this repo as well. They are in the [extensions](extensions) folder. My custom new tab page is signed (it's a modded fork of [Tab Notes][] by wildsky) but you will still need to "install addon from file" in `about:addons` since you're not downloading the extension package from a Mozilla domain. There are several search engine addons in the [extensions/search-extensions](extensions/search-extensions) folder. These simply add one-off search engines for websites like Google Images or YouTube, and some include search suggestions/autocomplete. Firefox already comes with Amazon and Wikipedia addons, but they have ugly icons and unnecessarily long labels. Mine are simply called Amazon and Wikipedia, and have icons that match the theme. Some of Firefox's built-in search engines also lack search suggestions even though the websites can provide suggestions. Some are signed and hosted on AMO, but others remain unsigned due to [an AMO bug][]. You can download the following search engines from AMO: [YouTube][]; [Google Translate][]; [Firefox Add-ons][]; [Searchfox][searchfox engine]; [Bugzilla][]; [MDN Web Docs][]; [Library Genesis][]; [Etsy][].

</details>

Expand Down Expand Up @@ -1348,6 +1348,7 @@ I've stopped accepting personal donations for the foreseeable future. But if you
[bugzilla]: https://addons.mozilla.org/firefox/addon/bugzilla-engine "Bugzilla OpenSearch Engine – Get this Extension for 🦊 Firefox"
[mdn web docs]: https://addons.mozilla.org/firefox/addon/mdn-engine "MDN Web Docs OpenSearch Engine – Get this Extension for 🦊 Firefox"
[library genesis]: https://addons.mozilla.org/firefox/addon/libgen-engine "Library Genesis OpenSearch Engine – Get this Extension for 🦊 Firefox"
[etsy]: https://addons.mozilla.org/firefox/addon/etsy-opensearch-engine "Etsy OpenSearch Engine – Get this Extension for 🦊 Firefox"
[multithreaded download manager]: https://addons.mozilla.org/firefox/addon/multithreaded-download-manager "Multithreaded Download Manager – Get this Extension for 🦊 Firefox"
[gitzip]: https://addons.mozilla.org/firefox/addon/gitzip "GitZip – Get this Extension for 🦊 Firefox"
[refined github]: https://addons.mozilla.org/firefox/addon/refined-github- "Refined GitHub – Get this Extension for 🦊 Firefox"
Expand Down
Binary file added extensions/search-extensions/search-etsy.zip
Binary file not shown.
Binary file not shown.
18 changes: 0 additions & 18 deletions prefs/.eslintrc.js

This file was deleted.

Loading

0 comments on commit 158fec4

Please sign in to comment.