ttalvitie / browservice

Browservice: Browse the modern web on historical browsers
MIT License
1.13k stars 32 forks source link

Add Popup Alert, Confirm, and Prompt box javascript for Browservice #47

Closed JeremyLyokoPPG2020 closed 2 years ago

JeremyLyokoPPG2020 commented 3 years ago

Alert Box image

function myFunction() {
alert("I am an alert box!");
}

and Line break for Alert box

alert("Hello\nHow are you?");

Confirm Box image

function myFunction() {
  var txt;
  if (confirm("Press a button!")) {
    txt = "You pressed OK!";
  } else {
    txt = "You pressed Cancel!";
  }
  document.getElementById("demo").innerHTML = txt;
}

Prompt Box image

function myFunction() {
  var txt;
  var person = prompt("Please enter your name:", "Harry Potter");
  if (person == null || person == "") {
    txt = "User cancelled the prompt.";
  } else {
    txt = "Hello " + person + "! How are you today?";
  }
  document.getElementById("demo").innerHTML = txt;
}

image

but Popup Box Alert, Confirm, and Prompt Box is not displayed on browservice? Try this link: W3schools JS Popup

ttalvitie commented 3 years ago

I think that at some point in the development of Browservice, I came to believe that supporting alert/prompt windows with the CEF off-screen rendering mode that Browservice uses is difficult or impossible; I could be mistaken. I should try to have a second look at some point on whether this could be done.

How important are alert/prompt windows in the modern web? I think those are nowadays typically implemented by adding an overlay div element.

JeremyLyokoPPG2020 commented 3 years ago

yes this popup alert/prompt dialog on browservice