forked from garimasingh128/profext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
94 lines (82 loc) Β· 3.16 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
var name_text = document.getElementById('name');
var website_link = document.getElementById('website_link');
var linkedin_link = document.getElementById('linkedin_link');
var medium_link = document.getElementById('medium_link');
var twitter_link = document.getElementById('twitter_link');
var github_link = document.getElementById('github_link');
var quora_link = document.getElementById('quora_link');
var stackoverflow_link = document.getElementById('stackoverflow_link');
var gitlab_link = document.getElementById('gitlab_link');
var facebook_link = document.getElementById('facebook_link');
var instagram_link = document.getElementById('instagram_link');
var array = ["name","website","linkedin","medium","twitter","github", "quora", "stackoverflow", "gitlab", "facebook", "instagram"];
function void_click(){
void(0);
}
chrome.storage.sync.get(array,function(links){
if(!chrome.runtime.error){
console.log(links);
if(links.name)
name_text.innerHTML=links.name+"'s ";
if(links.website)
website_link.href=links.website;
else
website_link.addEventListener('click',function(event){
event.preventDefault();
});
if(links.linkedin)
linkedin_link.href=links.linkedin;
else
linkedin_link.addEventListener('click',function(event){
event.preventDefault();
});
if(links.medium)
medium_link.href=links.medium;
else
medium_link.addEventListener('click',function(event){
event.preventDefault();
});
if(links.twitter)
twitter_link.href=links.twitter;
else
twitter_link.addEventListener('click',function(event){
event.preventDefault();
});
if(links.github)
github_link.href=links.github;
else
github_link.addEventListener('click',function(event){
event.preventDefault();
});
if(links.quora)
quora_link.href=links.quora;
else
quora_link.addEventListener('click',function(event){
event.preventDefault();
});
if(links.gitlab)
gitlab_link.href=links.gitlab;
else
gitlab_link.addEventListener('click',function(event){
event.preventDefault();
});
if(links.stackoverflow)
stackoverflow_link.href=links.stackoverflow;
else
stackoverflow_link.addEventListener('click',function(event){
event.preventDefault();
});
if(links.facebook)
facebook_link.href=links.facebook;
else
facebook_link.addEventListener('click',function(event){
event.preventDefault();
});
if(links.instagram)
instagram_link.href=links.instagram;
else
instagram_link.addEventListener('click',function(event){
event.preventDefault();
});
}
});