-
Notifications
You must be signed in to change notification settings - Fork 1
/
popup.js
57 lines (42 loc) · 1.9 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
/*Here we add a reference to the IDs present in the popup.html file and give it a proper name to it*/
var github_link = document.getElementById("github_link");
var linkedin_link = document.getElementById("linkedin_link");
var website_link = document.getElementById("website_link");
var medium_link = document.getElementById("medium_link");
var twitter_link = document.getElementById("twitter_link");
var kaggle_link = document.getElementById("kaggle_link");
var chitkara_link = document.getElementById("chitkara_link");
// var facebook_link = document.getElementById("facebook_link");
// var instagram_link = document.getElementById("instagram_link");
var leetcode_link = document.getElementById("leetcode_link");
let array = [
"github",
"linkedin",
"website",
"medium",
"twitter",
"kaggle",
"chitkara",
// "facebook",
// "instagram",
"leetcode",
];
function void_click() {
void 0;
}
/* It will showcase the result after clicking it*/
chrome.storage.sync.get(array, function (links) {
if (!chrome.runtime.error) {
console.log(links);
if (links.github) github_link.href =`https://github.com/${links.github}`;
if (links.linkedin) linkedin_link.href = `https://linkedin.com/in/${links.linkedin}`;
if (links.website) website_link.href = links.website;
if (links.medium) medium_link.href =`https://medium.com/${links.medium}`;
if (links.twitter) twitter_link.href = `https://twitter.com/${links.twitter}`;
if (links.kaggle) kaggle_link.href =`https://kaggle.com/${links.kaggle}`;
if (links.chitkara) chitkara_link.href =`https://punjab.chitkara.edu.in//Interface/index.php/${links.chitkara}`;
// if (links.facebook) facebook_link.href = `https://www.facebook.com/${links.facebook}`;
// if (links.instagram) instagram_link.href = `https://www.instagram.com/${links.instagram}`;
if (links.leetcode) leetcode_link.href = `https://leetcode.com/${links.leetcode}`;
}
});