playVideoOnDreambox as WebExtension
[playVideoOnDreambox.git] / src / options.js
1 function saveOptions(e)
2 {
3     browser.storage.sync.set(
4         {
5             proxyUrl: document.querySelector("#proxyUrl").value
6         }
7     );
8     e.preventDefault();
9 }
10
11 function restoreOptions()
12 {
13     var gettingItem = browser.storage.sync.get('proxyUrl');
14     gettingItem.then((res) => {
15         document.querySelector("#proxyUrl").value = res.proxyUrl || null;
16     });
17 }
18
19 document.addEventListener('DOMContentLoaded', restoreOptions);
20 document.querySelector('form').addEventListener('submit', saveOptions);