mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Disable range request loading for safari.
This commit is contained in:
parent
08e2f7a125
commit
e6dadaadb8
1 changed files with 18 additions and 1 deletions
|
@ -14,7 +14,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
/* globals VBArray */
|
/* globals VBArray, PDFJS */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -438,3 +438,20 @@
|
||||||
enumerable: true
|
enumerable: true
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
(function checkRangeRequests() {
|
||||||
|
// Safari has issues with cached range requests see:
|
||||||
|
// https://github.com/mozilla/pdf.js/issues/3260
|
||||||
|
// Last tested with version 6.0.4.
|
||||||
|
var isSafari = Object.prototype.toString.call(
|
||||||
|
window.HTMLElement).indexOf('Constructor') > 0;
|
||||||
|
if (!isSafari) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
document.addEventListener('DOMContentLoaded', function (e) {
|
||||||
|
if (isSafari) {
|
||||||
|
console.warn('Range requests are disabled for safari.');
|
||||||
|
PDFJS.disableRange = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue