|
|
@ -25,11 +25,18 @@ function MessageHandler(name, comObj) { |
|
|
|
var ah = this.actionHandler = {}; |
|
|
|
var ah = this.actionHandler = {}; |
|
|
|
|
|
|
|
|
|
|
|
ah['console_log'] = [function ahConsoleLog(data) { |
|
|
|
ah['console_log'] = [function ahConsoleLog(data) { |
|
|
|
console.log.apply(console, data); |
|
|
|
log.apply(null, data); |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
|
|
|
|
// If there's no console available, console_error in the
|
|
|
|
|
|
|
|
// action handler will do nothing.
|
|
|
|
|
|
|
|
if ('console' in globalScope) { |
|
|
|
ah['console_error'] = [function ahConsoleError(data) { |
|
|
|
ah['console_error'] = [function ahConsoleError(data) { |
|
|
|
console.error.apply(console, data); |
|
|
|
globalScope['console'].error.apply(null, data); |
|
|
|
}]; |
|
|
|
}]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
ah['console_error'] = [function ahConsoleError(data) { |
|
|
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
} |
|
|
|
ah['_warn'] = [function ah_Warn(data) { |
|
|
|
ah['_warn'] = [function ah_Warn(data) { |
|
|
|
warn(data); |
|
|
|
warn(data); |
|
|
|
}]; |
|
|
|
}]; |
|
|
@ -234,7 +241,7 @@ var WorkerMessageHandler = { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log('page=%d - getOperatorList: time=%dms, len=%d', pageNum, |
|
|
|
log('page=%d - getOperatorList: time=%dms, len=%d', pageNum, |
|
|
|
Date.now() - start, operatorList.fnArray.length); |
|
|
|
Date.now() - start, operatorList.fnArray.length); |
|
|
|
|
|
|
|
|
|
|
|
// Filter the dependecies for fonts.
|
|
|
|
// Filter the dependecies for fonts.
|
|
|
@ -266,7 +273,7 @@ var WorkerMessageHandler = { |
|
|
|
promise.reject(e); |
|
|
|
promise.reject(e); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log('text indexing: page=%d - time=%dms', |
|
|
|
log('text indexing: page=%d - time=%dms', |
|
|
|
pageNum, Date.now() - start); |
|
|
|
pageNum, Date.now() - start); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -277,7 +284,7 @@ var consoleTimer = {}; |
|
|
|
var workerConsole = { |
|
|
|
var workerConsole = { |
|
|
|
log: function log() { |
|
|
|
log: function log() { |
|
|
|
var args = Array.prototype.slice.call(arguments); |
|
|
|
var args = Array.prototype.slice.call(arguments); |
|
|
|
postMessage({ |
|
|
|
globalScope.postMessage({ |
|
|
|
action: 'console_log', |
|
|
|
action: 'console_log', |
|
|
|
data: args |
|
|
|
data: args |
|
|
|
}); |
|
|
|
}); |
|
|
@ -285,7 +292,7 @@ var workerConsole = { |
|
|
|
|
|
|
|
|
|
|
|
error: function error() { |
|
|
|
error: function error() { |
|
|
|
var args = Array.prototype.slice.call(arguments); |
|
|
|
var args = Array.prototype.slice.call(arguments); |
|
|
|
postMessage({ |
|
|
|
globalScope.postMessage({ |
|
|
|
action: 'console_error', |
|
|
|
action: 'console_error', |
|
|
|
data: args |
|
|
|
data: args |
|
|
|
}); |
|
|
|
}); |
|
|
@ -313,7 +320,7 @@ if (typeof window === 'undefined') { |
|
|
|
// throw an exception which will be forwarded on automatically.
|
|
|
|
// throw an exception which will be forwarded on automatically.
|
|
|
|
PDFJS.LogManager.addLogger({ |
|
|
|
PDFJS.LogManager.addLogger({ |
|
|
|
warn: function(msg) { |
|
|
|
warn: function(msg) { |
|
|
|
postMessage({ |
|
|
|
globalScope.postMessage({ |
|
|
|
action: '_warn', |
|
|
|
action: '_warn', |
|
|
|
data: msg |
|
|
|
data: msg |
|
|
|
}); |
|
|
|
}); |
|
|
|