Make sync update backwards compatible
This commit is contained in:
parent
3526b390d5
commit
7fe653eae3
|
@ -9,7 +9,11 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const replaceAll = () => {
|
const replaceAll = () => {
|
||||||
chrome.storage.sync.get(null, items => {
|
chrome.storage.sync.get(null, replaceAllInStorage)
|
||||||
|
chrome.storage.local.get(null, replaceAllInStorage)
|
||||||
|
}
|
||||||
|
|
||||||
|
const replaceAllInStorage = (items) => {
|
||||||
if (!items[DEACTIVATE_KEY]) {
|
if (!items[DEACTIVATE_KEY]) {
|
||||||
for (var key in items) {
|
for (var key in items) {
|
||||||
if (key == 'person') {
|
if (key == 'person') {
|
||||||
|
@ -20,7 +24,6 @@ const replaceAll = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const escapeAndReplace = (input_word, replace_value, case_sensitive) => {
|
const escapeAndReplace = (input_word, replace_value, case_sensitive) => {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "InteractiveFics",
|
"name": "InteractiveFics",
|
||||||
"author": "mariamrf",
|
"author": "mariamrf",
|
||||||
"version": "5.0.1",
|
"version": "5.0.2",
|
||||||
"description": "Replaces Y/N & other variables in Reader Insert/second person fics with words of your choice.",
|
"description": "Replaces Y/N & other variables in Reader Insert/second person fics with words of your choice.",
|
||||||
"browser_action": {
|
"browser_action": {
|
||||||
"default_title": "InteractiveFics",
|
"default_title": "InteractiveFics",
|
||||||
|
|
Loading…
Reference in New Issue