Skip to content

Commit

Permalink
treated a few bugs and errors that crept in
Browse files Browse the repository at this point in the history
errors fixed:
- wrongful url extraction for certification credentials
- wrongly extracting in deepscan if other button is clicked
  • Loading branch information
DrakenWan committed Aug 15, 2022
1 parent 98153e4 commit 05caeea
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scripts/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ function main() {
bodycontainer.value = JSON.stringify(data)

bodycontainer = document.getElementById("slider").querySelector("#sheaderheader");
var uname = document?.querySelector('div.pv-text-details__left-panel > div > h1').textContent || "";
var uname = document?.querySelector('div.pv-text-details__left-panel > div > h1') || null;
uname = uname?.textContent || "";
bodycontainer.innerHTML = "<h1>"+uname+"</h1>";
window.onscroll = function() {
data = extract();
Expand All @@ -102,7 +103,8 @@ function main() {
bodycontainer.value = JSON.stringify(data)

bodycontainer = document.getElementById("slider").querySelector("#sheaderheader");
var uname = document?.querySelector('div.pv-text-details__left-panel > div > h1').textContent || "";
var uname = document?.querySelector('div.pv-text-details__left-panel > div > h1') || null;
uname = uname?.textContent || "";
bodycontainer.innerHTML = "<h1>"+uname+"</h1>";
}

Expand Down Expand Up @@ -474,7 +476,7 @@ function extractCert() {
list = anchor1.querySelector('ul').children;
}

if(anchor2 && document.getElementById('deepscan').checked) {
if(anchor2 && document.getElementById('deepscan').checked && location.href.includes('certifications')) {
list = anchor2.children;
}

Expand All @@ -499,15 +501,12 @@ function extractCert() {
url = elem[4]?.querySelector('a')?.href || "";
//if anchor1
}
else if ((anchor1 == null) && anchor2 && document.getElementById('deepscan').checked) {
else if ((anchor1 == null) && anchor2 && document.getElementById('deepscan').checked && location.href.includes('certifications')) {
//alert("anchor2s");
elem = list[i].querySelector('div > div').nextElementSibling;
firstdiv = elem.firstElementChild.firstElementChild.children;

url = elem.firstElementChild;
if(url) url = url.nextElementSibling.querySelector('a');
if(url) url = url?.href || "";
else url = "";
url = elem.firstElementChild.nextElementSibling?.querySelector('a').href || "";
} //if anchor2
else {
break;
Expand Down Expand Up @@ -578,7 +577,8 @@ function extractSkills() {


}// anchor1 ends here
else if ((anchor1 == null) && anchor2 && document.getElementById('deepscan').checked) {
else if ((anchor1 == null) && anchor2 && document.getElementById('deepscan').checked &&
location.href.includes('skills')) {
elem = list[i].querySelector('div > div').nextElementSibling;
elem = elem.firstElementChild.firstElementChild.children;

Expand Down

0 comments on commit 05caeea

Please sign in to comment.