Adding WebViewer option xdomainProxyUrl causes Uncaught TypeError: Cannot read property 'statusText'

28 views
Skip to first unread message

Benjamin Roedell

unread,
Oct 24, 2016, 12:51:59 PM10/24/16
to PDFTron WebViewer
Adding WebViewer option xdomainProxyUrl causes Uncaught TypeError: Cannot read property 'statusText'



Here's what I think I know so far:
I think that xdomain.js is failing to modify the global object XMLHttpRequest and it leaves it as a useless object.  

The XMLHttpRequest seems to work fine before
<script src="external/xdomain.js" slave="https://c.na34.visual.force.com/apex/proxy"></script>
and after it is appended by the function exports.ControlUtils.initXdomain the XMLHttpRequest object doesn't look right (to me).

Many thanks for your help,
Ben

Matt Parizeau

unread,
Oct 26, 2016, 4:30:59 PM10/26/16
to PDFTron WebViewer
Hi Ben,

Thanks for the example! Can you try modifying xdomain.js line 136 that has listener.apply(undefined, args); and change it to listener.apply(this, args);

I think "this" isn't being set correctly so it isn't the XMLHttpRequest object in a function that we expect it to be.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Benjamin Roedell

unread,
Nov 1, 2016, 1:02:58 PM11/1/16
to PDFTron WebViewer
That solved it.  Thank you very much.
Reply all
Reply to author
Forward
0 new messages