In a large skillet, heat 2 tablespoons of the oil over moderate heat.
Add the onions, 1/2 teaspoon of the salt, and 1/8 teaspoon of the pepper. Cook, stirring frequently, until the onions are well cooked, about 15 minutes. Remove onions to a serving platter or individual plates.
In the same skillet, heat the remaining 1 tablespoon oil over moderately high heat.
Season the chicken livers with the remaining 1/4 teaspoon salt and 1/8 teaspoon pepper. Put the livers in the pan (in two batches if necessary) and cook for 2 minutes.
Turn and cook until browned, about 2 minutes longer.
The livers will still be pink inside. Remove the chicken livers from the pan and put them on top of the onions.
Return the skillet to the heat and add the Madeira. Boil rapidly, scraping the bottom of the pan to dislodge any brown bits, for 1 minute. Pour the sauce over the livers and the onions. Top with the egg and parsley.