mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-24 05:13:07 +09:00
- `--enable-official-branding` implies `MC_OFFICIAL` (no need to specifically set it) - `--enable-official-vendor` can be used to set `MC_OFFICIAL` on builds without `--enable-official-branding` that should still be considered official release versions. - `MC_OFFICIAL` implies `--enable-release`, meaning `DEVELOPER_OPTIONS` isn't set - `MC_OFFICIAL` makes `nsXULAppInfo.getIsOfficial` return `true` - `MC_OFFICIAL` makes `AppConstants.MOZILLA_OFFICIAL` (for compatibility in extensions) and `AppConstants.MC_OFFICIAL` return `true` - Optional, for the time being: `MOZILLA_OFFICIAL` is still present in some places in case someone wants to build a Mozilla-alike official application and has the rights and necessary keys to use Mozilla-official third-party services. This must always be combined with `MC_OFFICIAL` to have a sane combination of defines. This may be removed in the future.
67 lines
2.3 KiB
JavaScript
67 lines
2.3 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
"use strict";
|
|
|
|
this.EXPORTED_SYMBOLS = [ "AboutHomeUtils" ];
|
|
|
|
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
Components.utils.import("resource://gre/modules/Services.jsm");
|
|
|
|
this.AboutHomeUtils = {
|
|
/**
|
|
* Returns an object containing the name and searchURL of the original default
|
|
* search engine.
|
|
*/
|
|
get defaultSearchEngine() {
|
|
let defaultEngine = Services.search.defaultEngine;
|
|
let submission = defaultEngine.getSubmission("_searchTerms_", null, "homepage");
|
|
|
|
return Object.freeze({
|
|
name: defaultEngine.name,
|
|
searchURL: submission.uri.spec,
|
|
postDataString: submission.postDataString
|
|
});
|
|
},
|
|
|
|
/*
|
|
* showKnowYourRights - Determines if the user should be shown the
|
|
* about:rights notification. The notification should *not* be shown if
|
|
* we've already shown the current version, or if the override pref says to
|
|
* never show it. The notification *should* be shown if it's never been seen
|
|
* before, if a newer version is available, or if the override pref says to
|
|
* always show it.
|
|
*/
|
|
get showKnowYourRights() {
|
|
// Look for an unconditional override pref. If set, do what it says.
|
|
// (true --> never show, false --> always show)
|
|
try {
|
|
return !Services.prefs.getBoolPref("browser.rights.override");
|
|
} catch (e) { }
|
|
// Ditto, for the legacy EULA pref.
|
|
try {
|
|
return !Services.prefs.getBoolPref("browser.EULA.override");
|
|
} catch (e) { }
|
|
|
|
#ifndef MC_OFFICIAL
|
|
// Non-official builds shouldn't show the notification.
|
|
return false;
|
|
#endif
|
|
|
|
// Look to see if the user has seen the current version or not.
|
|
var currentVersion = Services.prefs.getIntPref("browser.rights.version");
|
|
try {
|
|
return !Services.prefs.getBoolPref("browser.rights." + currentVersion + ".shown");
|
|
} catch (e) { }
|
|
|
|
// Legacy: If the user accepted a EULA, we won't annoy them with the
|
|
// equivalent about:rights page until the version changes.
|
|
try {
|
|
return !Services.prefs.getBoolPref("browser.EULA." + currentVersion + ".accepted");
|
|
} catch (e) { }
|
|
|
|
// We haven't shown the notification before, so do so now.
|
|
return true;
|
|
}
|
|
};
|