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) * Added support for HDPI (retina) displays (#583)
* Corrected IIIF tile source to use canonical syntax (#586) * 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 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: 1.2.1:

View File

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