function restore_options() { chrome.storage.local.get('baseURL', function (result) { if(result && result.baseURL.startsWith('http')) { document.getElementById('open-stammtv').href = result.baseURL; } else { chrome.runtime.openOptionsPage(); } }); } document.addEventListener('DOMContentLoaded', restore_options);