-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.js
38 lines (30 loc) · 1.11 KB
/
options.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// options.js Starter code credit to ChatGPT
document.addEventListener('DOMContentLoaded', function () {
var enableToggle = document.getElementById('enableToggle');
var helpButton = document.getElementById('helpButton');
var aboutButton = document.getElementById('aboutButton');
var sdp = document.getElementById('sdpContainer');
var sdpInfo = document.getElementById('sdp');
// Load settings
chrome.storage.sync.get('enabled', function (result) {
enableToggle.checked = result.enabled || false;
});
enableToggle.addEventListener('change', function () {
var enabled = enableToggle.checked;
chrome.storage.sync.set({ 'enabled': enabled }, function () {
console.log('Settings saved:', enabled );
});
});
helpButton.addEventListener('click', function () {
window.open('../help/help.html');
});
aboutButton.addEventListener('click', function () {
window.open('../about/about.html');
});
sdp.addEventListener('mouseover', function () {
sdpInfo.style.display = 'block';
})
sdp.addEventListener('mouseleave', function () {
sdpInfo.style.display = 'none';
})
});