-
-
Notifications
You must be signed in to change notification settings - Fork 497
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
492 additions
and
367 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { | ||
_save, | ||
dictFromArray, | ||
extendObject, | ||
getSubSettings, | ||
start | ||
} from './start.js'; | ||
|
||
function loadRawSettings(keys, cb, defaultSet) { | ||
var rawSet = defaultSet || {}; | ||
chrome.storage.local.get(null, function(localSet) { | ||
var localSavedAt = localSet.savedAt || 0; | ||
chrome.storage.sync.get(null, function(syncSet) { | ||
var syncSavedAt = syncSet.savedAt || 0; | ||
if (localSavedAt > syncSavedAt) { | ||
extendObject(rawSet, localSet); | ||
_save(chrome.storage.sync, localSet, function() { | ||
var subset = getSubSettings(rawSet, keys); | ||
if (chrome.runtime.lastError) { | ||
subset.error = "Settings sync may not work thoroughly because of: " + chrome.runtime.lastError.message; | ||
} | ||
cb(subset); | ||
}); | ||
} else if (localSavedAt < syncSavedAt) { | ||
extendObject(rawSet, syncSet); | ||
cb(getSubSettings(rawSet, keys)); | ||
_save(chrome.storage.local, syncSet); | ||
} else { | ||
extendObject(rawSet, localSet); | ||
cb(getSubSettings(rawSet, keys)); | ||
} | ||
}); | ||
}); | ||
} | ||
|
||
function _applyProxySettings(proxyConf) { | ||
} | ||
|
||
function _setNewTabUrl(){ | ||
return "favorites://"; | ||
} | ||
|
||
function _getContainerName(self, _response){ | ||
} | ||
|
||
function getLatestHistoryItem(text, maxResults, cb) { | ||
} | ||
|
||
start({ | ||
getLatestHistoryItem, | ||
loadRawSettings, | ||
_applyProxySettings, | ||
_setNewTabUrl, | ||
_getContainerName | ||
}); |
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
Oops, something went wrong.