-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
72 lines (66 loc) · 2.89 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
document.addEventListener('DOMContentLoaded', () => {
document.querySelector("#dfsgyu8769sa").addEventListener("click", () => {
if (typeof password == "undefined") {
if (document.getElementById("password-field").value.length == 0) {
document.getElementById("password-alert").style.display = 'block';
} else {
password = document.getElementById("password-field").value;
}
}
console.log(password);
chrome.tabs.query({ active: true, currentWindow: true }, function(activeTabs) {
chrome.tabs.sendMessage(activeTabs[0].id, { passphrase: password})
chrome.tabs.executeScript(activeTabs[0].id, { file: 'encryption.js' })
chrome.tabs.executeScript(activeTabs[0].id, { file: 'content.js' })
})
window.close();
})
document.querySelector("#hjgdfnshkjyu").addEventListener("click", () => {
if (typeof password == "undefined") {
if (document.getElementById("password-field").value.length == 0) {
document.getElementById("password-alert").style.display = 'block';
} else {
password = document.getElementById("password-field").value;
}
}
document.querySelector('#jvhktuy45346').value = `encrypt_begin ${cipherHash(document.querySelector("#jvhktuy45346").value, password)} encrypt_end`;
document.querySelector("#jvhktuy45346").select();
document.execCommand("copy");
document.getElementById("alert").style.display = "block";
setTimeout(() => {
document.getElementById("jvhktuy45346").value = '';
document.getElementById("alert").style.display = 'none';
window.close();
}, 800)
})
document.querySelector("#password-field").addEventListener('input', () => {
document.getElementById("password-alert").style.display = 'none';
})
document.querySelector("#main").addEventListener("click", () => {
if (document.querySelector("#main").classList.contains("active-left")) {
// Do nothing
} else {
document.querySelector("#main").classList.add("active-left");
document.querySelector("#single-use").classList.remove("active-right");
document.getElementById("main-tab").style.display = "block";
document.getElementById("single-use-tab").style.display = "none";
}
})
document.querySelector("#single-use").addEventListener("click", () => {
if (document.querySelector("#single-use-tab").classList.contains("active-right")) {
// Do nothing
} else {
document.querySelector("#single-use").classList.add("active-right");
document.querySelector("#main").classList.remove("active-left");
document.getElementById("single-use-tab").style.display = "block";
document.getElementById("main-tab").style.display = "none";
}
})
document.querySelector("#inject").addEventListener("click", () => {
window.close();
chrome.tabs.query({ active: true, currentWindow: true }, (activeTabs) => {
chrome.tabs.executeScript(activeTabs[0].id, { file: 'encryption.js' });
chrome.tabs.executeScript(activeTabs[0].id, { file: 'inject.js' });
})
})
})