You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
630 B
21 lines
630 B
4 years ago
|
const defaultSettings = {
|
||
|
chatWidth: 300,
|
||
|
highlightColor: '#FFEA9E'
|
||
|
};
|
||
|
|
||
|
chrome.storage.sync.get(defaultSettings, (settings) => {
|
||
|
document.querySelector('#chatWidth').value = settings.chatWidth;
|
||
|
document.querySelector('#highlightColor').value = settings.highlightColor;
|
||
|
});
|
||
|
|
||
|
document.querySelector('#saveButton').addEventListener('click', (event) => {
|
||
|
settings = {
|
||
|
chatWidth: document.querySelector('#chatWidth').value,
|
||
|
highlightColor: document.querySelector('#highlightColor').value
|
||
|
}
|
||
|
|
||
|
chrome.storage.sync.set(settings, () => {
|
||
|
console.log('Settings saved');
|
||
|
});
|
||
|
}, false);
|