Remove PDFJS.disableRange/PDFJS.disableStream code for now unsupported browsers in src/shared/compatibility.js
				
					
				
			We're currently disabling range requests and streaming for a number of configurations. A couple of those will no longer be supported (with PDF.js version 2.0), hence we ought to be able to clean up the compatibility code slightly.
This commit is contained in:
		
							parent
							
								
									eb3a1f24a3
								
							
						
					
					
						commit
						745cb73c65
					
				@ -25,10 +25,8 @@ var globalScope = require('./global_scope');
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
var userAgent = (typeof navigator !== 'undefined' && navigator.userAgent) || '';
 | 
					var userAgent = (typeof navigator !== 'undefined' && navigator.userAgent) || '';
 | 
				
			||||||
var isAndroid = /Android/.test(userAgent);
 | 
					var isAndroid = /Android/.test(userAgent);
 | 
				
			||||||
var isAndroidPre3 = /Android\s[0-2][^\d]/.test(userAgent);
 | 
					 | 
				
			||||||
var isAndroidPre5 = /Android\s[0-4][^\d]/.test(userAgent);
 | 
					var isAndroidPre5 = /Android\s[0-4][^\d]/.test(userAgent);
 | 
				
			||||||
var isChrome = userAgent.indexOf('Chrom') >= 0;
 | 
					var isChrome = userAgent.indexOf('Chrom') >= 0;
 | 
				
			||||||
var isChromeWithRangeBug = /Chrome\/(39|40)\./.test(userAgent);
 | 
					 | 
				
			||||||
var isIOSChrome = userAgent.indexOf('CriOS') >= 0;
 | 
					var isIOSChrome = userAgent.indexOf('CriOS') >= 0;
 | 
				
			||||||
var isIE = userAgent.indexOf('Trident') >= 0;
 | 
					var isIE = userAgent.indexOf('Trident') >= 0;
 | 
				
			||||||
var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent);
 | 
					var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent);
 | 
				
			||||||
@ -470,19 +468,12 @@ PDFJS.compatibilityChecked = true;
 | 
				
			|||||||
  PDFJS.locale = navigator.userLanguage || 'en-US';
 | 
					  PDFJS.locale = navigator.userLanguage || 'en-US';
 | 
				
			||||||
})();
 | 
					})();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Support: Safari 6.0+, Android<3.0, Chrome 39/40, iOS
 | 
					// Support: Safari 6.0+, iOS
 | 
				
			||||||
(function checkRangeRequests() {
 | 
					(function checkRangeRequests() {
 | 
				
			||||||
  // Safari has issues with cached range requests see:
 | 
					  // Safari has issues with cached range requests see:
 | 
				
			||||||
  // https://github.com/mozilla/pdf.js/issues/3260
 | 
					  // https://github.com/mozilla/pdf.js/issues/3260
 | 
				
			||||||
  // Last tested with version 6.0.4.
 | 
					  // Last tested with version 6.0.4.
 | 
				
			||||||
 | 
					  if (isSafari || isIOS) {
 | 
				
			||||||
  // Older versions of Android (pre 3.0) has issues with range requests, see:
 | 
					 | 
				
			||||||
  // https://github.com/mozilla/pdf.js/issues/3381.
 | 
					 | 
				
			||||||
  // Make sure that we only match webkit-based Android browsers,
 | 
					 | 
				
			||||||
  // since Firefox/Fennec works as expected.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  // Range requests are broken in Chrome 39 and 40, https://crbug.com/442318
 | 
					 | 
				
			||||||
  if (isSafari || isAndroidPre3 || isChromeWithRangeBug || isIOS) {
 | 
					 | 
				
			||||||
    PDFJS.disableRange = true;
 | 
					    PDFJS.disableRange = true;
 | 
				
			||||||
    PDFJS.disableStream = true;
 | 
					    PDFJS.disableStream = true;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user