In a deep skillet, bring 2 to 3 inches of water to a boil. Add beans, season with salt and par-boil 3-5 minutes depending on thickness of the beans. Cool under cold running water, reserve in strainer.
Return pan to stovetop and melt butter over medium heat. Add onions and stir; reduce heat to medium-low and cook, stirring occasionally to caramelize the onions, 25-30 minutes. Reduce heat if they brown too quickly at edges. Add stock and beans, and turn with tongs to combine. Season with salt and pepper to taste.