11

I made a browser extension:

  1. reloads the page.
  2. open another tab from the same host and close it automatically.
  3. switch tabs to be active automatically (every 2 minutes one of these sites becomes active).

those work, but they had bad user experience. Reloading the page might lose work.

I tried making requests on the background but these websites use many confusing headers and cookies.

Is there a better way to stop logging off due to inactivity or a proper way to figure out which headers and cookies should I attach?

I don't know which stack these websites use, but they have high security standards.

3
  • "is there a better way to stop logging off due to inactivity or a proper way to figure out which headers and cookies should I attach with my request??" You can attach all headers and cookies your browser attaches. Commented Nov 26, 2020 at 9:15
  • do you know a way I can attach all headers and cookies Commented Nov 26, 2020 at 9:38
  • 2
    In Firefox or Chrome I'd press Ctrl+Q, go to Network and choose one request. There I'd copy all headers. Next I'd go to Storage and copy all cookies. Commented Nov 26, 2020 at 9:51

1 Answer 1

6

Once "Are you still there?" messages pops up, I right click, inspect, copy the selector, then do this in the console:

# paste your selector in this variable selector = "#j_idt473 > div.modal-footer > a.btn.btn-primary.btn-sm" document.querySelector(selector).click() 

If that works, I then put it in a intervalID = window.setInterval(callback, milliseconds) call. I stop the loop with window.clearInterval(intervalID) if needed.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.