function injectTwoWorkspaces() {
  const options = {
    toolbox: toolboxCategories,
  };
  workspace1 = Blockly.inject('blockly1', options);
  workspace2 = Blockly.inject('blockly2', options);
  // If we allow undoing operations, it can create event loops when sharing
  // events between workspaces.
  workspace1.MAX_UNDO = 0;
  workspace2.MAX_UNDO = 0;
  workspace1.addChangeListener(createEventSharer(workspace2));
  workspace2.addChangeListener(createEventSharer(workspace1));

  workspace1.addChangeListener(
    createSerializationListener(workspace1, 'save1'),
  );
  workspace2.addChangeListener(
    createSerializationListener(workspace2, 'save2'),
  );

  document
    .getElementById('load')
    .addEventListener('click', () => reloadWorkspaces());
}
Injects two workspaces that share procedure models. Undo and redo are off.