-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoptions.js
More file actions
14 lines (13 loc) · 693 Bytes
/
options.js
File metadata and controls
14 lines (13 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
document.addEventListener('DOMContentLoaded', function() {
chrome.storage.sync.get(['forwardUrl', 'wsPassword'], function(result) {
document.getElementById('forward-url').value = result.forwardUrl || 'ws://localhost:4444';
document.getElementById('ws-password').value = result.wsPassword || '';
});
document.getElementById('save-settings').addEventListener('click', function() {
const forwardUrl = document.getElementById('forward-url').value;
const wsPassword = document.getElementById('ws-password').value;
chrome.storage.sync.set({ forwardUrl, wsPassword }, function() {
alert('Settings saved!');
});
});
});