Microsoft has acquired GitHub. Decentraleyes has left GitHub. Welcome to its new home!

To participate, please register, or sign in with an existing GitLab.com, Bitbucket, or GitHub account.

Past contributions on GitHub? Be sure to reclaim your Comments, Issues, and Pull Requests.

Improve variable name consistency

parent 159f907e
......@@ -23,9 +23,9 @@ var main = {};
* Private Methods
*/
main._initializeOptions = function () {
main._initializeSettings = function () {
let optionDefaults = {
let settingDefaults = {
[Setting.XHR_TEST_DOMAIN]: Address.DECENTRALEYES,
[Setting.SHOW_ICON_BADGE]: true,
[Setting.BLOCK_MISSING]: false,
......@@ -35,26 +35,26 @@ main._initializeOptions = function () {
[Setting.WHITELISTED_DOMAINS]: {}
};
chrome.storage.local.get(optionDefaults, function (options) {
chrome.storage.local.get(settingDefaults, function (items) {
if (options === null) {
options = optionDefaults; // Restore option defaults.
if (items === null) {
items = settingDefaults; // Restore setting defaults.
}
if (options.blockMissing === true) {
if (items.blockMissing === true) {
stateManager.setExtensionEnvironment('staging');
} else {
stateManager.setExtensionEnvironment('stable');
}
if (options.disablePrefetch !== false) {
if (items.disablePrefetch !== false) {
chrome.privacy.network.networkPredictionEnabled.set({
'value': false
});
}
chrome.storage.local.set(options);
chrome.storage.local.set(items);
});
};
......@@ -77,9 +77,9 @@ main._showReleaseNotes = function (details) {
chrome.storage.local.get({
[Setting.SHOW_RELEASE_NOTES]: true
}, function (options) {
}, function (items) {
if (options.showReleaseNotes === true) {
if (items.showReleaseNotes === true) {
chrome.tabs.create({
'url': location,
......@@ -96,7 +96,7 @@ main._showReleaseNotes = function (details) {
*/
chrome.runtime.onInstalled.addListener(main._showReleaseNotes);
main._initializeOptions();
main._initializeSettings();
wrappers.setBadgeBackgroundColor({
'color': [74, 130, 108, 255]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment