Heat the oil in a large skillet, cook the onions until soft. Add potatoes and cook over medium-heat until almost done with no color, about 10 minutes. Break the potatoes up a bit with a spatula, then transfer the potatoes and onions to the bowl with the eggs. Stir the potatoes around to cover well with the egg, and season with salt and pepper. Remove most of the oil from the skillet, leaving about 1 tablespoon. Add the egg mixture, reduce the heat to low and cook omelet slowly until golden and firm enough to flip. Carefully flip omelet, slipping it onto another plate if necessary, and cook until done, it should still be soft inside, and about 1-inch thick.
Cut omelet into squares and serve immediately hot, or let cool to room temperature and serve.