mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Replaces all preprocessor directives with PDFJSDev calls.
This commit is contained in:
parent
bf52ff156d
commit
0576c9c6c6
32 changed files with 1145 additions and 904 deletions
|
@ -83,17 +83,19 @@ var CustomStyle = (function CustomStyleClosure() {
|
|||
return CustomStyle;
|
||||
})();
|
||||
|
||||
//#if !(FIREFOX || MOZCENTRAL || CHROME)
|
||||
function hasCanvasTypedArrays() {
|
||||
var canvas = document.createElement('canvas');
|
||||
canvas.width = canvas.height = 1;
|
||||
var ctx = canvas.getContext('2d');
|
||||
var imageData = ctx.createImageData(1, 1);
|
||||
return (typeof imageData.data.buffer !== 'undefined');
|
||||
var hasCanvasTypedArrays;
|
||||
if (typeof PDFJSDev === 'undefined' ||
|
||||
!PDFJSDev.test('FIREFOX || MOZCENTRAL || CHROME')) {
|
||||
hasCanvasTypedArrays = function hasCanvasTypedArrays() {
|
||||
var canvas = document.createElement('canvas');
|
||||
canvas.width = canvas.height = 1;
|
||||
var ctx = canvas.getContext('2d');
|
||||
var imageData = ctx.createImageData(1, 1);
|
||||
return (typeof imageData.data.buffer !== 'undefined');
|
||||
};
|
||||
} else {
|
||||
hasCanvasTypedArrays = function () { return true; };
|
||||
}
|
||||
//#else
|
||||
//function hasCanvasTypedArrays() { return true; }
|
||||
//#endif
|
||||
|
||||
var LinkTarget = {
|
||||
NONE: 0, // Default value.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue