-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread.js
48 lines (47 loc) · 1.65 KB
/
read.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
window.onload = function () {
const profileName = document.getElementById("profileName");
let displayLink = document.getElementById("displayLink");
let linkedinButton = document.getElementById("linkedinButton");
let twitterButton = document.getElementById("twitterButton");
let portfolioButton = document.getElementById("portfolioButton");
let githubButton = document.getElementById("githubButton");
let instagramButton = document.getElementById("instagramButton");
chrome.storage.sync.get(["name"], function (result) {
profileName.innerHTML = `Hi ${result.name}, how are you?`;
});
linkedinButton.onclick = () => {
chrome.storage.sync.get(["linkedin"], function (result) {
displayLink.value = result.linkedin;
displayLink.select();
document.execCommand("copy");
});
};
twitterButton.onclick = () => {
chrome.storage.sync.get(["twitter"], function (result) {
displayLink.value = result.twitter;
displayLink.select();
document.execCommand("copy");
});
};
portfolioButton.onclick = () => {
chrome.storage.sync.get(["portfolio"], function (result) {
displayLink.value = result.portfolio;
displayLink.select();
document.execCommand("copy");
});
};
githubButton.onclick = () => {
chrome.storage.sync.get(["github"], function (result) {
displayLink.value = result.github;
displayLink.select();
document.execCommand("copy");
});
};
instagramButton.onclick = () => {
chrome.storage.sync.get(["instagram"], function (result) {
displayLink.value = result.instagram;
displayLink.select();
document.execCommand("copy");
});
};
};