1

I am pretty new to front-end and trying to confirm conceptually first before I start to implement it.

For example, I want to return a static HTML file to the user's rest call request. That way, I can open HTML page on the user's side and get input. Along that line, I want to insert puppeteer code inside of the static HTML file to navigate to certain websites before getting the user's input.

Does it make sense? If not, can you please explain why?

ljeon
  • 15
  • 2
  • puppeteer is a browser. you can't run a browser inside another browser. you can navigate a user to another page, but there is no way to get their input from that other page. these things are security risks. – I wrestled a bear once. Aug 20 '20 at 20:51
  • 1
    There is a project, puppeteer-web, that attempts to run puppeteer in a browser context. See [this question's answer](https://stackoverflow.com/q/54647694/215552) for more info, but be forewarned, it's trying to fit a square peg into a round hole... – Heretic Monkey Aug 20 '20 at 20:52

1 Answers1

0

It doesn't make sense to me. Puppeteer is a Node.js library. It's meant to be run on a machine, not in the browser. Based on what you want to do, I would explore using an <iframe> to load the other websites and writing JavaScript to control the <iframe> and get whatever input you need.

Ian Walter
  • 882
  • 2
  • 8
  • 23