Unable to run automation on firefox using puppeteer

I followed the documentation to add firefox as a browser for the automation but it kept running only on Chrome or either getting these errors:
Error: Could not find Firefox (rev. latest). This can occur if either

  1. you did not perform an installation for Firefox before running the script (e.g. PUPPETEER_PRODUCT=firefox npm install) or
  2. your cache path is incorrectly configured (which is: /Users/temp_user/.cache/puppeteer).
    For (2), check out our guide on configuring puppeteer at Configuration | Puppeteer.
    TypeError: Cannot read properties of undefined (reading ‘mainFrame’)

also is it possible to run on Safari?

I think the Safari/webkit is not supported by Puppeteer yet. FAQ | Puppeteer

Or you could try Playwright helper which is supporting all your needs, Chrome/Firefox/Webkit. Playwright | CodeceptJS