Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

276
Views
Haga clic automáticamente en cada pestaña en el navegador web y haga clic en el botón Enviar

Dado un conjunto de páginas web abiertas en un navegador, todas desde el mismo sitio web, cada una con un botón de envío, ¿es posible escribir algo que vaya a cada pestaña y haga clic en el botón de envío?

Me pregunto si se podría hacer algo así con un administrador de scripts de usuario, como Greasemonkey o Tampermonkey.

O, alternativamente, ¿hay alguna forma de que cuando se abra la página web en lugar de simplemente abrirla, podría abrirla, esperar a que se cargue y luego presionar el botón Enviar?

La página web se abre a través de un form , no con window.open() :

 <form target="_blank" action="https://acoustid.org/edit/toggle-track-mbid" method="POST"> <input name="state" value="1" hidden=""> <input name="track_id" value="9509889" hidden=""> <input name="mbid" value="6573f01d-0df5-442d-90c3-a69783c217c3" hidden=""> <input type="submit" value="Unlink"> </form>

Aquí está el sitio web . Haga clic en Desvincular para abrir una nueva ventana y ver el formulario ( necesita una cuenta ):

desvincular formulario MBID

Su HTML es:

 <form method="POST" action="/edit/toggle-track-mbid"> <div class="form-group"> <label for="note_i">Comment:</label> <textarea class="form-control" name="note" id="name_i"></textarea> </div> <input type="hidden" name="mbid" value="b3350a3b-b8e0-45c0-8289-006451788849"> <input type="hidden" name="track_id" value="12211538"> <input type="hidden" name="state" value="1"> <input type="hidden" name="submit" value="1"> <input type="submit" class="btn btn-default" value="Submit"> </form>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El form se puede enviar sin tener que abrir otro en una pestaña nueva. La diferencia entre los formularios Desvincular y Enviar es que este último tiene dos valores nuevos: submit establecido en 1 (es decir, desvincular cuando se envía el formulario) y note , un comentario para explicar la desvinculación.

Sin embargo, desde que se publicó la pregunta, agregó el parámetro submit=1 al primer formulario, de modo que una pista se puede desvincular directamente haciendo clic en el botón Desvincular .

Aquí hay una solución que automatiza un poco el proceso:

 // ==UserScript== // @name Submit all forms // @version 0.1 // @description see https://stackoverflow.com/questions/70227065 // @author double-beep // @match http://reports.albunack.net/*.html // @grant GM_xmlhttpRequest // ==/UserScript== (function() { 'use strict'; async function submitAllForms() { const forms = document.querySelectorAll('table > tbody > tr > :nth-child(2) > form'); const formPromises = [...forms].map(form => { const formData = new FormData(form); if (!formData.get('submit')) { // old version of the website formData.set('submit', '1'); } return new Promise((resolve, reject) => { GM_xmlhttpRequest({ method: 'POST', // post url: form.action, data: formData, onload: resolve, onerror: reject }); }); }); await Promise.all(formPromises); } const submitButton = document.createElement('input'); submitButton.value = 'Submit forms'; submitButton.type = 'submit'; submitButton.addEventListener('click', async () => { submitButton.disabled = true; submitButton.innerText = 'Please wait...'; await submitAllForms(); submitButton.disabled = false; submitButton.value = 'Re-submit forms'; }); document .querySelector('table') .previousElementSibling .insertAdjacentElement('beforebegin', submitButton); });

El único problema es que los track_id no coinciden y no hay nada que el script de usuario pueda hacer al respecto.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!