-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpopup.js
More file actions
35 lines (32 loc) · 840 Bytes
/
popup.js
File metadata and controls
35 lines (32 loc) · 840 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
window.onload = function(){
var enabledCheck = document.getElementById('enableWhv');
var retryCheck = document.getElementById('retry');
var applyBtn = document.getElementById('applyBtn');
chrome.storage.sync.get({
enableWhv: false,
retry: false
}, function(args){
enabledCheck.checked = !!args.enableWhv;
retryCheck.checked = !!args.retry;
});
enabledCheck.addEventListener('change', function(){
chrome.storage.sync.set({
enableWhv: enabledCheck.checked
});
});
retryCheck.addEventListener('change', function(){
chrome.storage.sync.set({
retry: retryCheck.checked
});
});
applyBtn.addEventListener('click', function(){
chrome.storage.local.set({
whvstep: 0
}, function(){
chrome.tabs.create({
url: 'http://www.immigration.govt.nz/migrant/default.htm',
active: true
});
});
});
};