Skip to content

Commit

Permalink
Added support for CareerOne job listings
Browse files Browse the repository at this point in the history
Improved match patterns for some URL permissions
  • Loading branch information
zevnda committed Dec 4, 2024
1 parent 0b48c6d commit 9ffa1bc
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

## Features
- ✅ Chrome and Firefox versions available
- ✅ Support for Seek, Jora, Indeed, and LinkedIn job listings
- ✅ Support for Seek, Jora, Indeed, LinkedIn, and CareerOne job listings

## How to use
1. Find a job listing on one of the supported sites and copy the URL
Expand Down
1 change: 1 addition & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function buildManifest(browser) {
);
});
copyDirectory(path.join(__dirname, 'icons'), path.join(dirPath, 'icons'));
console.log(`Successfully built ${browser} dist to ${dirPath}`);
}

buildManifest('chrome');
Expand Down
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Fixed an issue that required the JSE page to be refreshed after adding a job in order to have the input added to the page again
- Added support for CareerOne job listings
- Improved match patterns for some URL permissions
19 changes: 17 additions & 2 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ function initializeExtension() {

// Add new div to form - retry if form not found
function addDivToForm() {
console.log('check');
const form = document.querySelector('.container-fluid');
if (!form) {
setTimeout(() => addDivToForm(), retryInterval);
Expand Down Expand Up @@ -123,7 +122,7 @@ function createButton() {
return button;
}

// Handle button clikc
// Handle button click
async function handleButtonClick(e) {
e.preventDefault();
const input = document.querySelector(`#${buttonId} input`);
Expand All @@ -141,6 +140,7 @@ async function handleButtonClick(e) {
if (url.includes('au.jora.com/')) fillFormFromJora(jobData);
if (url.includes('au.indeed.com/')) fillFormFromIndeed(jobData);
if (url.includes('linkedin.com/')) fillFormFromLinkedin(jobData);
if (url.includes('careerone.com.au/')) fillFormFromCareerOne(jobData);
} catch (error) {
console.error('Error:', error.message);
}
Expand Down Expand Up @@ -227,6 +227,21 @@ function fillFormFromLinkedin(htmlData) {
setSelectValue('select[name="ApplicationMethod"]', 'ONEX');
}

function fillFormFromCareerOne(htmlData) {
const parser = new DOMParser();
const doc = parser.parseFromString(htmlData, 'text/html');

const jobTitle = doc.querySelector('h1.jv-title')?.textContent;
const jobLocation = doc.querySelector('a.text-dark-500[title]')?.textContent;
const jobAgent = doc.querySelector('a.text-title-3.text-black')?.textContent;

setInputValue('input[name="JobTitle"]', jobTitle, 50);
setInputValue('input[name="JobLocation"]', jobLocation);
setInputValue('input[name="AgentName"]', jobAgent);
setInputValue('input[name="EmployerContact"]', 'Online');
setSelectValue('select[name="ApplicationMethod"]', 'ONEX');
}

// Set input value
function setInputValue(selector, value, maxLength) {
const input = document.querySelector(selector);
Expand Down
11 changes: 6 additions & 5 deletions manifest.chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
"content_scripts": [
{
"matches": [
"https://www.workforceaustralia.gov.au/*",
"https://www.seek.com.au/*",
"https://au.jora.com/*",
"https://au.indeed.com/*",
"https://*.linkedin.com/*"
"https://*.workforceaustralia.gov.au/*",
"https://*.seek.com.au/*",
"https://*.jora.com/*",
"https://*.indeed.com/*",
"https://*.linkedin.com/*",
"https://*.careerone.com.au/*"
],
"js": [
"content.js"
Expand Down
20 changes: 11 additions & 9 deletions manifest.firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"version": "1.2.3",
"description": "Fill out your job search efforts on the Workforce Australia website with ease",
"permissions": [
"https://www.workforceaustralia.gov.au/*",
"https://www.seek.com.au/*",
"https://au.jora.com/*",
"https://au.indeed.com/*",
"https://*.workforceaustralia.gov.au/*",
"https://*.seek.com.au/*",
"https://*.jora.com/*",
"https://*.indeed.com/*",
"https://*.linkedin.com/*",
"https://*.careerone.com.au/*",
"webRequest",
"webRequestBlocking"
],
Expand All @@ -20,11 +21,12 @@
"content_scripts": [
{
"matches": [
"https://www.workforceaustralia.gov.au/*",
"https://www.seek.com.au/*",
"https://au.jora.com/*",
"https://au.indeed.com/*",
"https://*.linkedin.com/*"
"https://*.workforceaustralia.gov.au/*",
"https://*.seek.com.au/*",
"https://*.jora.com/*",
"https://*.indeed.com/*",
"https://*.linkedin.com/*",
"https://*.careerone.com.au/*"
],
"js": [
"content.js"
Expand Down

0 comments on commit 9ffa1bc

Please sign in to comment.