How to get input from Chrome's Javascript console?

前端 未结 6 775
情话喂你
情话喂你 2020-12-29 06:21

Is there a way to programmatically get input from the Javascript Console of Google Chrome, similar to readline() in Firefox?

6条回答
  •  我在风中等你
    2020-12-29 07:04

    Sorry, doesn't work on Chrome JS Console, just works on the repl from repl.it

    Example from repl.it:

    console.log("Enter your name:");
    console.read(function(name) {
      console.log('Your name is ' + name + '.');
    });
    

提交回复
热议问题