init() {
    const disableMenuItem =
      Blockly.ContextMenuRegistry.registry.getItem('blockDisable');
    this.oldPreconditionFn = disableMenuItem.preconditionFn;
    disableMenuItem.preconditionFn = function (
      /** @type {!Blockly.ContextMenuRegistry.Scope} */ scope,
    ) {
      const block = scope.block;
      if (
        !block.isInFlyout &&
        block.workspace.options.disable &&
        block.isEditable()
      ) {
        if (block.getInheritedDisabled() || isOrphan(block)) {
          return 'disabled';
        }
        return 'enabled';
      }
      return 'hidden';
    };
  }
Modifies the context menu 'disable' option as described above.