Fixed Firefox 35 not able to open local files (#588)

This commit is contained in:
Antoine Vandecreme 2015-02-10 18:28:05 -05:00
parent 32fa3fc13f
commit 6662001aae
2 changed files with 7 additions and 3 deletions

View File

@ -51,6 +51,7 @@ OPENSEADRAGON CHANGELOG
* Added support for HDPI (retina) displays (#583)
* Corrected IIIF tile source to use canonical syntax (#586)
* Fixed x/y typo that caused horizontal reference strip to be rendered only relative to height (#595)
* Fixed Firefox 35 not able to open local files (#588)
1.2.1:

View File

@ -1984,9 +1984,12 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
if ( request.readyState == 4 ) {
request.onreadystatechange = function(){};
var successStatus =
protocol === "http:" || protocol === "https:" ? 200 : 0;
if ( request.status === successStatus ) {
// With protocols other than http/https, the status is 200
// on Firefox and 0 on other browsers
if ( request.status === 200 ||
( request.status === 0 &&
protocol !== "http:" &&
protocol !== "https:" )) {
onSuccess( request );
} else {
$.console.log( "AJAX request returned %d: %s", request.status, url );