diff --git a/web/compatibility.js b/web/compatibility.js index e9b69ed07..0d12c64a9 100644 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -92,6 +92,13 @@ if (typeof PDFJS === 'undefined') { window.Float64Array = TypedArray; })(); +// URL = URL || webkitURL +(function normalizeURLObject() { + if (!window.URL && window.webkitURL) { + window.URL = window.webkitURL; + } +})(); + // Object.create() ? (function checkObjectCreateCompatibility() { if (typeof Object.create !== 'undefined') diff --git a/web/viewer.js b/web/viewer.js index 106164e19..d28afcc00 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/* globals URL*/ /* globals PDFJS, PDFBug, FirefoxCom, Stats, Cache, PDFFindBar */ /* globals PDFFindController, ProgressBar, getFileName, CustomStyle */ /* globals getOutputScale, TextLayerBuilder */ @@ -975,8 +976,7 @@ var PDFView = { // ); // } //#endif - var URL = window.URL || window.webkitURL; - // If the PDF is not ready yet, or if createObjectURL is not supported, + // If the PDF is not ready yet, or if URL.createObjectURL is not supported, // just try to download with the url. if (!this.pdfDocument || !URL) { noData();