BrowserPrint JavaScript and Chrome 84/85

With the latest updates to Chrome (Build 84, 85) as well as Edge, etc. BrowserPrint JavaScript no longer appears to function. We've been searching for any news/word on this and did not come across anything, other than noticing https://www.zebra.com/us/en/forms/browser-print-request-javascript.html is no longer valid. Is BrowserPrint JavaScript dead/no longer supported?

Can anyone advise on this issue and how to resolve? What we'll have to do in order to get printing from our browser-based app working? Relevant links, information would be appreciated.

-----------

More info: From Chrome's M85 release notes we found the following:

> We plan to also enable CORS for content script requests starting in M85.

We added sec-fetch-* meta data to the HTTP requests and it appears we've restored functionality. However, it'd be great to get some confirmation and/or information from someone at Zebra regarding this and if we should move away from BrowserPrint Javascript.

Thank you,
Mark

Steven Si
Hi Mark,

Hi Mark,

The BrowserPrint is still supported and will continue to be supported in the future. The link to request a copy of the BrowserPrint is still valid. If the link returns an error, please make sure you clear the browser cookies, caches, etc.

Recently, Zebra has released a cloud-based API for printing, it’s called SendFileToPrinter API. This can be a great alternative to the BrowserPrint. See Use the SendFileToPrinter API for Your Cloud-Based Printing Needs for more information.

Regarding your sec-fetch-* question, I don’t think it has any impact to the BrowserPrint or vice versa. The BrowserPrint simply provides the connection between the browser and the printer. The BrowserPrint doesn’t involve in HTTP request.

Hop this helps.

Regards,

Steven Si

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Raja Karuppasamy
Browser print to be used in Salesforce platform

Hello folks,
I am a newbie to work with any type of printers; so pls excuse if the terminologies I used here are different. I have a web app hosted in Salesforce cloud platform. My requirement is to add printing option enabled in my web page in Salesforce to print directly to Zebra ZD620 printer. Salesforce provides its own hybrid mobile app in both android and IOS platforms. I want this option to work in all platforms - Android, IOS and also in Windows and OSx operation systems.

I am considering BrowserPrint option so that using Javascript library in my web page, I can invoke printing via local wireless network that the printer is connected to (from Salesforce mobile app, ipads or from desktops). I have few questions before starting this with -
1. Will BrowserPrint work in all the operation systems that I mentioned?
2. When I downloaded BrowserPrint SDK, I got this "zebra-browser-print-js-v30216". Is this the latest version that I can try?
3. My understanding is BrowserPrint will work only if we install respective OS drivers in the devices
4. If driver app is mandatory, I can get driver only for Android from here: https://www.zebra.com/us/en/support-downloads/printer-software/by-reques.... This page says if I need driver for Windows & OSx, I should email Zebra customer care which I did 2 days back but no response yet. Is there any other ways to get driver software?
5. For BrowserPrint to work, is it sufficient to have Js library and respective driver in my devices?
6. Our primary requirement is to trigger print via local wireless network and from mobile devices and ipads (some cases desktops as well). If there is any other reliable technology from Browserprint, please advise.

Any suggestions or help will be greatly appreciated. Thanks in advance!

** I am posting here because I couldn't find an option in the community to start a new post. Any suggestion on this as well will be helpful :)

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Steven Si
1. The BrowserPrint currently

1. The BrowserPrint currently only works on Android, PC and Mac OSX. It doesn't work on iOS.

2. The BrowserPrint downloads that are hosted on the page of https://www.zebra.com/us/en/support-downloads/printer-software/by-reques... are the latest releases.

3. No, the BrowserPrint doesn't need any drivers. The BrowserPrint connects to the printer directly.

4. As said in #3, the BrowserPrint doesn't use driver. As indicated on the page above, you need to email the customersolutions@zebra.com to request the BrowserPrint for Windows & Mac OSX.

5. You only need the JS libraries in order for the BrowserPrint to work.

6. The way the BrowserPrint works is to connect to the printer directly from the device (desktop or mobile device) directly over USB, Bluetooth or TCP/IP. Since you plan to use WiFi to do the print, the mobile device and the printer will be both on the network. An alternative to the BrowserPrint, a much simpler alternative in my view, would be the SendFileToPrint API, a cloud-based print alternative. Check out this article - Use SendTileToPrinter API Your Cloud-Based Printing Needs

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Raja Karuppasamy
Thank you very much Steven

Thank you very much Steven for the response. It is great to see you helping many in the forum.
I tried SendFileToPrint API method and I could successfully establish the connection and print from Postman but from Salesforce I couldn't print. Salesforce has its own programming language called Apex. Apex doesn't directly support multipart/form-data but we write custom logic to frame form data body by ourselves and we POST it as a blob. When I tried the same to post the txt file to Zebra. It gave me back the below error

{"fault":{"faultstring":"Execution of JS-ExtractPrinterList failed with error: Javascript runtime error: \"TypeError: Cannot read property \"1\" from null. (JS-ExtractPrinterList.js:7)\"","detail":{"errorcode":"steps.javascript.ScriptExecutionFailed"}}}

Any idea on this? Does this mean Zebra API doesn't accept blob? And is there any way to talk to Zebra technical team about this? Thank you for your help!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Steven Si
Hi Raja,

Hi Raja,

Unfortunately, the SendFileToPrinter API currently only supports multipart/form-data. Would the Apex allow you to call functions in other language, such as JavaScript or Java? If that is possible, then you can create a JavaScript or Java function to call SendFileToPrinter API and let Apex to call that function as a workaround.

Regards,

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Raja Karuppasamy
Issue is solved

Thanks again Steven.
I was able to solve the issue by base16 encoding the string directly in Apex. Also, was able to succeed in JavaScript using XHR :)

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Steven Si
That's great to hear. Thank

That's great to hear. Thank you Raja. Would you be able to share the code snippet with Base16 encoding to bypass Apex limitation, so that other people can benefit from it?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments