Place the sliced onions in a large skillet over medium heat.
Cover and cook, stirring occasionally, until the onions are dry and just beginning to stick to the pan, about 20 minutes.
Add a large pinch of salt, the oil, optional jalapeño, red chile, mustard seeds, cumin, and coriander seeds.
Continue to cook, uncovered, stirring occasionally until the onions are deeply browned and caramelized, at least 15 more minutes.
Stir the brown sugar into the onion mixture and cook for one minute more until it dissolves.
Carefully transfer the contents of the skillet to a food processor. Process until the chutney is nearly smooth.
Taste and adjust the seasoning if necessary.
Serve warm or at room temperature.