Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1853013 - Ship 118.3.0 of feature-webcompat
- Loading branch information
1 parent
3de0f39
commit 4fe5f5e
Showing
6 changed files
with
203 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...e/webcompat/src/main/assets/extensions/webcompat/experiment-apis/aboutConfigPrefsChild.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* 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"; | ||
|
||
/* global ExtensionAPI, Services, XPCOMUtils */ | ||
|
||
this.aboutConfigPrefs = class extends ExtensionAPI { | ||
getAPI(context) { | ||
const extensionIDBase = context.extension.id.split("@")[0]; | ||
const extensionPrefNameBase = `extensions.${extensionIDBase}.`; | ||
|
||
return { | ||
aboutConfigPrefs: { | ||
getBoolPrefSync(prefName, defaultValue = false) { | ||
try { | ||
return Services.prefs.getBoolPref( | ||
`${extensionPrefNameBase}${prefName}`, | ||
defaultValue | ||
); | ||
} catch (_) { | ||
return defaultValue; | ||
} | ||
}, | ||
}, | ||
}; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters