blockCopyToStorageContextMenu() {
    /** @type {!Blockly.ContextMenuRegistry.RegistryItem} */
    const copyToStorageOption = {
      displayText: function () {
        if (Blockly.Msg['CROSS_TAB_COPY']) {
          return Blockly.Msg['CROSS_TAB_COPY'];
        }
        return 'Copy';
      },
      preconditionFn: function (
        /** @type {!Blockly.ContextMenuRegistry.Scope} */ scope,
      ) {
        if (
          Blockly.getSelected().isDeletable() &&
          Blockly.getSelected().isMovable()
        ) {
          return 'enabled';
        }
        return 'disabled';
      },
      callback: function (
        /** @type {!Blockly.ContextMenuRegistry.Scope} */ scope,
      ) {
        localStorage.setItem(
          'blocklyStash',
          JSON.stringify(scope.block.toCopyData()),
        );
      },
      scopeType: Blockly.ContextMenuRegistry.ScopeType.BLOCK,
      id: 'blockCopyToStorage',
      weight: 0,
    };
    Blockly.ContextMenuRegistry.registry.register(copyToStorageOption);
  }
Adds a copy command to the block context menu.