I am trying to use a google extension to keep name of people that I have already seen on Linkedin
Form this picture when I click the next page or change the page I am trying to get the google extension to keep the track of the name of person in this page.
This is my Manifest:
{
"manifest_version": 2,
"name": "One test",
"description": "test.",
"version": "1.0",
"background": {"scripts": ["test.js"]},
"page_action":
{
"default_icon": "pic1.png"
},
"permissions": ["tabs"],
"content_security_policy": "script-src 'self' https://www.jbhired.com; object-src 'self' "
}
And these are the functions I am trying to use to keep track of the data:
function check(tab_id, data, tab) {
if (tab.url.indexOf('https://www.linkedin.com/search/results/people/') > -1) {
chrome.pageAction.show(tab_id);
}
};
chrome.tabs.onUpdated.addListener(check);
// _______________________________________________________________________
var data = (function(){
return {
bigArr: [],
}
})();
var interfaceCtrl = (function() {
var selector = document.querySelector('.page-list');
return {
selectTwo: selector.childNodes[1].childNodes[5],
cons: document.querySelector('.nav-item__profile-member-photo').alt,
nextClass: document.querySelector('.next'),
selectOne: selector.childNodes[1].childNodes[2].classList.value
}
})();
var listeners = (function(arr, ui){
document.querySelector('.results-paginator').addEventListener('click',function(event){
if(event.target.innerText === ui.selectTwo.innerText || ( event.target.classList.value === 'next-text' && ui.selectOne == 'active')) {
arr.bigArr.push({
consultant: ui.cons,
search: window.location.href,
time: Date.now()
});
}
});
})(data,interfaceCtrl);
I am trying try but it's still not working. I'm really a newbie on both javascript and google extensions. help me please :(