mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Added fallback to fake worker if serialization of typed array fails.
This happens e.g. in Opera 11.60.
This commit is contained in:
parent
f10a543080
commit
fdcc4ca590
1 changed files with 7 additions and 1 deletions
|
@ -605,7 +605,13 @@ var PDFDoc = (function PDFDocClosure() {
|
|||
}.bind(this));
|
||||
|
||||
var testObj = new Uint8Array(1);
|
||||
messageHandler.send('test', testObj);
|
||||
// Some versions of Opera throw a DATA_CLONE_ERR on serializing the typed array.
|
||||
// If such an error occurs, we fallback to a faked worker.
|
||||
try {
|
||||
messageHandler.send('test', testObj);
|
||||
} catch (e) {
|
||||
this.setupFakeWorker();
|
||||
}
|
||||
} else {
|
||||
this.setupFakeWorker();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue