Melt the butter in a saucepan over medium heat. Add the onions. Season with salt, and saute for 2 minutes.
Add the pineapple, red bell pepper and habanero. Continue to saute until the pineapple is soft, about 7 minutes, stirring frequently.
Add the vinegar and the sugar. Bring the mixture to a boil.
In a small bowl, combine the cornstarch and water, and whisk until smooth. Stir the slurry into the pineapple mixture and return mixture to a boil. Continue to cook for 4 minutes, stirring constantly. Remove from the heat.
For a smoother consistency, pour the chutney into a blender or food processor and pulse until consistency desired.