-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpopup.js
54 lines (45 loc) · 1.45 KB
/
popup.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
setInterval(function () { console.log(chrome.runtime.lastError); }, 500);
document.getElementById('sign').onsubmit = function (e) {
e.preventDefault();
chrome.runtime.sendNativeMessage(
'io.linux_fu.chrome_gpg_agent',
{method: 'sign', message: document.getElementById('signText').value},
function (res) {
console.log(res.message);
}
);
};
document.getElementById('verify').onsubmit = function (e) {
e.preventDefault();
chrome.runtime.sendNativeMessage(
'io.linux_fu.chrome_gpg_agent',
{method: 'verify', message: document.getElementById('verifyText').value},
function (res) {
console.log(res.message);
}
);
};
document.getElementById('encrypt').onsubmit = function (e) {
e.preventDefault();
chrome.runtime.sendNativeMessage(
'io.linux_fu.chrome_gpg_agent',
{
method: 'encrypt',
message: document.getElementById('encText').value,
recipient: document.getElementById('encRecip').value
},
function (res) {
console.log(res.message);
}
);
};
document.getElementById('decrypt').onsubmit = function (e) {
e.preventDefault();
chrome.runtime.sendNativeMessage(
'io.linux_fu.chrome_gpg_agent',
{method: 'decrypt', message: document.getElementById('decText').value},
function (res) {
console.log(res.message);
}
);
};