Printing directly from browser sucks. I’ve tried all kind of things, but only if you can approach the printer directly it never worked flawless for me.
My solution was to create a PDF file, put it on a place the printer could access to and then send a command to print that file.
And for a label printer. Create a TXT file and put it on a default place the label printer can access. Then run some kind of script that triggers the label printer.