send (name, args, callback) {
    const that = this;
    cbid++;

    this.callbacks[cbid] = callback;
    setTimeout((function (callbackID) {
      return function () { // Delay for the callback to be set in case its synchronous
        /*
        * Todo: Handle non-JSON arguments and return values (undefined,
        *   nonfinite numbers, functions, and built-in objects like Date,
        *   RegExp), etc.? Allow promises instead of callbacks? Review
        *   SVG-Edit functions for whether JSON-able parameters can be
        *   made compatile with all API functionality
        */
        // We accept and post strings for the sake of IE9 support
        let sameOriginWithGlobal = false;
        try {
          sameOriginWithGlobal = window.location.origin === that.frame.contentWindow.location.origin &&
            that.frame.contentWindow.svgEditor.svgCanvas;
        }catch (err) {/* empty */}

        if (sameOriginWithGlobal) {
          // Although we do not really need this API if we are working same
          //  domain, it could allow us to write in a way that would work
          //  cross-domain as well, assuming we stick to the argument limitations
          //  of the current JSON-based communication API (e.g., not passing
          //  callbacks). We might be able to address these shortcomings; see
          //  the todo elsewhere in this file.
          const message = { id: callbackID };
          const { svgEditor: { canvas: svgCanvas } } = that.frame.contentWindow;
          try {
            message.result = svgCanvas[name](...args);
          } catch (err) {
            message.error = err.message;
          }
          addCallback(that, message);
        } else { // Requires the ext-xdomain-messaging.js extension
          that.frame.contentWindow.postMessage(JSON.stringify({
            namespace: 'svgCanvas', id: callbackID, name, args
          }), '*');
        }
      };
    }(cbid)), 0);

    return cbid;
  }
@param {string} name
@param {ArgumentsArray} args Signature dependent on function
@param {GenericCallback} callback (This may be better than a promise in case adding an event.)
@returns {Integer}