code: function wrapDcSend(dc, pc) {
        var origDataChannelSend = dc.send;
        dc.send = function() {
          var data = arguments[0];
          var length = data.length || data.size || data.byteLength;
          if (dc.readyState === 'open' &&
              pc.sctp && length > pc.sctp.maxMessageSize) {
            throw new TypeError('Message too large (can send a maximum of ' +
              pc.sctp.maxMessageSize + ' bytes)');
          }
          return origDataChannelSend.apply(dc, arguments);
        };
      }
docs: Note: Although Firefox >= 57 has a native implementation, the maximum message size can be reset for all data channels at a later stage. See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831