Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

253
Visualizações
Way to automatically open browser at certain time of day using JavaScript?

Is there a way to open browser and automate tasks using JavaScript while my computer is on but without having anything opened? Perhaps using NodeJS? Just to clarify, I'm not talking about JS methods like window.open(), I'm talking about automating tasks on hardware level.

For instance:

  1. Open Chrome at 12:00PM on Wednesday.
  2. Go to google.com.
  3. Sign in.

If JavaScript can't do it, what language should I learn that's closest to JavaScript syntax?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

In Node Js, you need to spin up a server that will do this job for you. Here is the code i have used to open up a browser with a URL

const { platform } = require('os'); const { exec } = require('child_process');

const WINDOWS_PLATFORM = 'win32'; const MAC_PLATFORM = 'darwin';

const osPlatform = platform();
const args = process.argv.slice(2);
const [url] = args;

if (url === undefined) {
  console.error('Please enter a URL, e.g. "http://www.opencanvas.co.uk"');
  process.exit(0);
}

let command;

if (osPlatform === WINDOWS_PLATFORM) {
  command = `start microsoft-edge:${url}`;
} else if (osPlatform === MAC_PLATFORM) {
  command = `open -a "Google Chrome" ${url}`;
} else {
  command = `google-chrome --no-sandbox ${url}`;
}

console.log(`executing command: ${command}`);

exec(command);

Now you can get time with following code

new Date().getTime()

Combination of these will be hopefully work the thing you need. thanks Please follow this article for further information on how to sign into a website https://marian-caikovski.medium.com/automatically-sign-in-with-google-using-puppeteer-cc2cc656da1c

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda