Skip to content

Commit

Permalink
linkedin9 (#1214)
Browse files Browse the repository at this point in the history
* lib

* updated status route

* updated ui for status

* trying to suppress redundant logs

* updated logic to estimate status refresh progress

* updated templates decleration and refresh progress tracking

* fixing build issues

* templates.json

* fixing build issue wip

* fixing build

* trying to fix build, specifically chrome launch in debug mode

* fixed connection farmer and alert status

* build issue fixed

* fixing accessibility of the app locally

* updated status check and delay for refreshing

* fixing build

* fixing build

* fixing production url

* fixing next url in prod from passing port from rust

* removing bin

* restore ui_monitor binary

* icon and chrome launch fix attempt

* updated readme

* server alert log removed, refresh cron job with ui rendering

* fixing farming restart

* wip, need to restore stats update logic, better to separate it

* fixed stop buttons

* localstorage

* build fix

* handling null

* null check

* fixing null issues

* commenting out pipe sdk

* restriction check

* saving state when loading and restriction lighter check

* logs in ui, next build clean up, more logs when starting

* persisting state for chrom session in json

* build fix

* extra logs removed

* fixing merge again

* text embeds wip ollama

* migration for text embed table

* added text embed function

* new cli flag for text embed

* new cli flag for text embed

* exporting text embed crate

* text embed db batch operation for add command

* semantic search endpoint

* semantic search endpoint

* route with widrawal

* new sequence to run check through pending more 14 days connections

* new sequence for quick withdrawal

* updated ui loggin

* updated ui loggin

* updated ui loggin

* updated ui loggin

* restoring main branch add.rs

* updated stop logic

* updated loading button and status pill

* removed reload button, only kept comment

* updated logic to scroll and updated status for connections

* updated logic to stop sequence if needed

* updated functions to save status for connections

* new sequence to check recently added connections

* fixed repetition

* fixing intel chip chrome launch on arm

* forxing arm arch

* updated logging

* updated logging

* updated logging

* updated logging

* updated logging

* force browser to run in the background

* setting up chrome according to user screen dimensions

* setting up chrome according to user screen dimensions

* removing too much text

* returned and improved reload button

* text edit

* removed duplicated line

* call tauri to resize default window

* add the tauri call at the entry point

* keep track of cron logs

* new auto start route for cron job for harvesting

* cron job json

* additional check for puppeteer seession to prevent detached frame

* auto update harvesting status and remove auto start logic since it is in cron job now

* fixed json

* comments

* comments

* fixing chrome start up, keeping user tabs

* passing key message from the backend to ui

* passing key message from the backend to ui

* passing key message from the backend to ui

* debugging chrome set up

* improving storage of chrome and browser session

* fixing check for connection satus

* passing message and checking for heartbeat

* passing message and checking for heartbeat

* keeping user tabs alive, opening new tab for linkedin, reusing linked tab if exist

* keeping user tabs alive, opening new tab for linkedin, reusing linked tab if exist

* keeping user tabs alive, opening new tab for linkedin, reusing linked tab if exist

* sentry default set up

* sentry default set up

* sentry default set up

* sentry default set up

* sentry default set up

* sentry default set up

* sentry default set up

* sentry default set up

* sentry default set up

* sentry default set up

* fixing next build issue

* fixing navigation error and withdrawal sequence logic

* Revert "Merge pull request #205 from m13v/linkedin-8"

This reverts commit f5c36d0, reversing
changes made to e5b56e6.

* fixing navigation

* fixing navigation error and withdrawal sequence logic2

* fixing navigation error and withdrawal sequence logic

* importing santry

* handling 404 profile page

* new logger function with santry

* new logger function with santry

* new logger function with santry

* new logger function with santry

* new logger function with santry

* new logger function with santry

* new logger function with santry

* new logger function with santry

* fixing build

* saving user tabs and focusing on linkedin tab when opened

* fixing user tabs and linkedin focus
  • Loading branch information
m13v authored Jan 25, 2025
1 parent 7220d74 commit 14cda42
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions pipes/linkedin-ai-assistant/lib/browser-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,26 @@ export async function setupBrowser(logger: RouteLogger = defaultLogger): Promise
let pages = await activeBrowser.pages();
logger.log(`found ${pages.length} pages`);

let linkedinPage = pages.find(page => page.url().startsWith('https://www.linkedin.com'));
// Find LinkedIn page or create new one without closing others
let linkedinPage = pages.find(page => {
const url = page.url();
return url.startsWith('https://www.linkedin.com') || url === 'about:blank';
});

if (linkedinPage) {
logger.log('found existing linkedin page, reusing it');
logger.log('found existing linkedin or blank page, reusing it');
activePage = linkedinPage;
// If it's a blank page, we don't need to do anything special
if (linkedinPage.url() === 'about:blank') {
logger.log('using blank page for linkedin');
}
await activePage.bringToFront();
logger.log('brought linkedin page to front');
} else {
logger.log('no existing linkedin page found, opening a new tab');
logger.log('creating new tab for linkedin');
activePage = await activeBrowser.newPage();
logger.log('new tab opened');
await activePage.bringToFront();
logger.log('new tab created and brought to front');
}
session.setActivePage(activePage);
logger.log('browser setup complete');
Expand All @@ -69,6 +80,7 @@ export async function setupBrowser(logger: RouteLogger = defaultLogger): Promise
}
}


if (!activeBrowser) {
logger.error(`all connection attempts failed: ${lastError}`);
throw new Error(`failed to connect to browser after 5 attempts: ${lastError}`);
Expand Down

0 comments on commit 14cda42

Please sign in to comment.