Commit 0eaba6b4 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Add settings change listener

I found it's on chrome.storage and not chrome.storage.sync. This also works with Firefox now.
Also removes the need to have the options page explicitly send a signal that settings changed.

Differential Revision: https://phabricator.kde.org/D24203
parent 83602d80
......@@ -202,7 +202,7 @@ function connectHost() {
sendDownloads();
}
addRuntimeCallback("settings", "changed", function () {
SettingsUtils.onChanged().addListener(() => {
sendSettings();
});
......
......@@ -82,8 +82,6 @@ function loadSettings() {
}
return;
}
sendMessage("settings", "changed");
});
});
}
......
......@@ -49,6 +49,8 @@ class SettingsUtils {
}
});
}
}
static onChanged() {
return chrome.storage.onChanged;
}
}
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