cannot load PDFTron UI with Google Chrome v88 and a multi-server cluster

Hi I am getting this error in Google Chrome v88:

Auto Generated Inline Image 1.png
The same page and code runs OK either when I use a lower version of Chrome (which uses PNaCl native client) or when I access a single server.
Unfortunately, when I use a higher Chrome version (which abandon PNaCl) to access a multi-server cluster, the above error shows, and the PDFTron component cannot load (i.e. forever loading).
I also tried to force Chrome to use PNaCl and, though it works, the Chrome crashes quite oftern.
I already used the --disable-web-security but it does not help.
Anyone met anything similar before ?

Hi Wand,

I’m wondering if you can check the network tab and see what is going on with those file that are failing to be load?
If possible, please send a screenshot of the network tab,

Anthony Chen
Software Developer

PDFTron Systems, Inc.

Hi Anthony,

We found that the issue can be worked around by removing the pair of brotli compressed WebAssembly javascript and mem files, and adding a pair of plain text WebAsssembly files.
That seems to force the PDFTron fallback mechanism to switch to use the plain text version of the WebAssembly javascripts, and then things work.
FYI, the problem and complication that we observed are:

  1. Google Chrome latest version makes PNaCl obsolete
  2. PDFTron wants to switch to use WebAssembly
  3. There are multiple version of WebAssembly that PDFTron wants to choose, seems in the order of br > gz > plain text
  4. Our server (sometimes behind a Tomcat load balancer, sometimes behind an IP load balancer, just IP distribution but without IP shielding) wants to serve the BR file, but cannot, probably coz we use JBoss EAP 6. (You know there are so many web servers there where they are not all configurable for serving BR well.)
  5. Sometimes under some configuration the Google Chrome reject to load BR files via https, probably due to security or cross site scripting. (Anyway there are lots of complications.)
  6. We can make Chrome to load the gz version of WebAssembly, but then PDFTron fallback mechanism seems to incorrectly think the gz is br, so it fails to decompress.
  7. Finally we remove the br file pair from the server, and use brotli to decompress the br file pair into plain text and place them on the server. Then PDFTron works.

Hope that helps.

Hey Wand,

Glad to hear you were able to resolve the issue by finding a workaround.

Anthony Chen

Software Developer

PDFTron Systems, Inc.