mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Fixing test execution / relative URL protocol detection
This commit is contained in:
parent
03cb546f29
commit
cba531e3cd
1 changed files with 3 additions and 2 deletions
|
@ -33,8 +33,9 @@ function getPdf(arg, callback) {
|
|||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', params.url);
|
||||
xhr.mozResponseType = xhr.responseType = 'arraybuffer';
|
||||
xhr.expected = (params.url.indexOf('http:') === 0 ||
|
||||
params.url.indexOf('https:') === 0) ? 200 : 0;
|
||||
var protocol = params.url.indexOf(':') < 0 ? window.location.protocol :
|
||||
params.url.substring(0, params.url.indexOf(':') + 1);
|
||||
xhr.expected = (protocol === 'http:' || protocol === 'https:') ? 200 : 0;
|
||||
|
||||
if ('progress' in params)
|
||||
xhr.onprogress = params.progress || undefined;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue