-
Notifications
You must be signed in to change notification settings - Fork 0
/
content_gd.js
26 lines (22 loc) · 1.12 KB
/
content_gd.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
// Listen for messages
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
// If the received message has the expected format...
if (msg.text === 'report_back') {
var data = {};
data.title = document.getElementsByClassName("breadcrumb ib ")[1].textContent;
data.title = data.title.replace(/<(?:.|\n)*?>/gm, '');
data.title = data.title.replace('>', '');
data.company = document.getElementsByClassName("breadcrumb ib ")[4].textContent;
data.company = data.company.replace(/<(?:.|\n)*?>/gm, '');
var state = document.getElementsByClassName("breadcrumb ib ")[2].textContent;
state = state.replace(/<(?:.|\n)*?>/gm, '');
state = state.replace('>', '');
var city = document.getElementsByClassName("breadcrumb ib ")[3].textContent;
city = city.replace(/<(?:.|\n)*?>/gm, '');
city = city.replace('>', '');
city = city.slice(0, -2);
data.location = city + ", " + state;
data.description = document.getElementsByClassName("jobDescriptionContent desc")[0].innerHTML;
sendResponse(data)
}
});