Don't include transferable on IE11 on postMessage
This commit is contained in:
parent
7cd2aded63
commit
11ff845c3e
|
@ -15,9 +15,10 @@ if (typeof Array.prototype.find === 'undefined') {
|
||||||
if (typeof Array.from === 'undefined') {
|
if (typeof Array.from === 'undefined') {
|
||||||
require('core-js/fn/array/from');
|
require('core-js/fn/array/from');
|
||||||
}
|
}
|
||||||
if (typeof Promise === 'undefined') {
|
|
||||||
require('core-js/fn/promise');
|
// No if-statement on Promise because of IE11. Otherwise Promise is undefined in the service worker.
|
||||||
}
|
require('core-js/fn/promise');
|
||||||
|
|
||||||
if (typeof Uint8Array.from === 'undefined') {
|
if (typeof Uint8Array.from === 'undefined') {
|
||||||
require('core-js/fn/typed/uint8-array');
|
require('core-js/fn/typed/uint8-array');
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,9 @@ import config from './config';
|
||||||
import util from './util'; // re-import module to access util functions
|
import util from './util'; // re-import module to access util functions
|
||||||
import b64 from './encoding/base64';
|
import b64 from './encoding/base64';
|
||||||
|
|
||||||
export default {
|
const isIE11 = typeof navigator !== 'undefined' && !!navigator.userAgent.match(/Trident\/7\.0.*rv:([0-9.]+).*\).*Gecko$/);
|
||||||
|
|
||||||
|
export default {
|
||||||
isString: function(data) {
|
isString: function(data) {
|
||||||
return typeof data === 'string' || String.prototype.isPrototypeOf(data);
|
return typeof data === 'string' || String.prototype.isPrototypeOf(data);
|
||||||
},
|
},
|
||||||
|
@ -51,6 +52,10 @@ export default {
|
||||||
* @returns {Array<ArrayBuffer>} an array of binary data to be passed
|
* @returns {Array<ArrayBuffer>} an array of binary data to be passed
|
||||||
*/
|
*/
|
||||||
getTransferables: function(obj) {
|
getTransferables: function(obj) {
|
||||||
|
// Internet Explorer does not support Transferable objects.
|
||||||
|
if (isIE11) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
if (config.zero_copy && Object.prototype.isPrototypeOf(obj)) {
|
if (config.zero_copy && Object.prototype.isPrototypeOf(obj)) {
|
||||||
const transferables = [];
|
const transferables = [];
|
||||||
util.collectBuffers(obj, transferables);
|
util.collectBuffers(obj, transferables);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user