0

We have a Chrome extension and we'd like to print the contents of the popup.html.

Does anyone know how I can print this with javascript?

THANK YOU!!!

  • Does this answer your question? [Print the contents of a DIV](https://stackoverflow.com/questions/2255291/print-the-contents-of-a-div) – Jay Patel Jan 01 '22 at 07:28
  • See my comments in the [same-topic question](https://stackoverflow.com/questions/70545331/window-print-not-working-in-browser-extension). – wOxxOm Jan 01 '22 at 10:25

1 Answers1

0

To print a page in JS you need the print() method of the window object:

function printPage(){
      window.print()
   }

but if you want to print a single element See This