-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.js
More file actions
36 lines (27 loc) · 732 Bytes
/
options.js
File metadata and controls
36 lines (27 loc) · 732 Bytes
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
$('input[name="background-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
console.log(this); // DOM element
});
$('.save').click(function () {
console.log($('#userName').val())
var newName = $('#userName').val()
if (newName){
chrome.storage.sync.set({'userName': newName})
}
window.location='vocabTab.html'
}
)
var getStorage = function(){
console.log('getStorage')
var data = chrome.storage.sync.get(function(obj){
return obj
})
return data
}
$('.getStuff').click(function() {
var a = chrome.storage.sync.get('userName', function(obj) {
console.log(obj['userName'])
})
})
// $('.getStuff').click(function() {
// chrome.storage.sync.get(function(obj){console.log(obj)})
// })