Tengo la siguiente página web que muestra una terminal. Escribe en la barra inferior (por ejemplo, ayuda) y se emite una respuesta.
Entrada de prueba: /problemas sin resolver
Si ingresa lo anterior, notará que la salida incluye un hipervínculo. He intentado varias cosas para que el enlace se abra no solo en una nueva pestaña, sino también en una ventana emergente con un ancho y alto fijos.
La parte relevante del código está aquí:
} else if (input.value === "/unsolvedproblems" || input.value==="unsolvedproblems") { matrixEffect(); clearCommand(); textArea.innerHTML += "<br><br>--------Greatest unsolved problems--------<br><br>Here is a list of the greatest <a href='https://en.wikipedia.org/wiki/Lists_of_unsolved_problems' target=_'blank'><strong><u>unsolved problems</u></strong></a> in the world (check out the ones on Computer Science!)";Yo he tratado:
<a href=onclick="window.open'https://en.wikipedia.org/wiki/Lists_of_unsolved_problems' target=_'blank' 'width=600,height=600'>y algunas otras opciones y siguen recibiendo errores.
El código completo (trinket está aquí) https://trinket.io/html/c979638f8e?runMode=autorun
También probé esto, nuevamente con errores:
} else if (input.value === "/bye" || input.value==="bye") { matrixEffect(); clearCommand(); textArea.innerHTML += "<br><br>--------Goodbye!--------<br><br>Have a good day! <a href="https:www.google.com" target="popup" onclick="window.open('https:www.google.com','popup','width=600,height=600,scrollbars=no,resizable=no'); return false;"> Open Link in Popup </a>";¿Estás preguntando cómo abrir un enlace en una ventana emergente? Si es así, entonces podría intentar esto.
<input type="button" value="Open popup" onclick="window.open('https://en.wikipedia.org/wiki/Lists_of_unsolved_problems','popUpWindow','height=500,width=700,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');">