Last active
July 11, 2020 10:24
-
-
Save anupamhaldkar/0127985be45b47e7e1f452b3e78528dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var name_text = document.getElementById('name'); | |
var linkedin_link = document.getElementById('linkedin_link'); | |
var medium_link = document.getElementById('medium_link'); | |
var twitter_link = document.getElementById('twitter_link'); | |
let array = ["name","linkedin","medium","twitter"]; | |
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.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(); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment