Combine flour, yeast, and salt in a large bowl; stir in water and 4 tablespoons oil until wet, sticky dough forms.
Cover with plastic wrap; rise at room temperature 1 to 2 hours until doubled.
Meanwhile, heat 2 tablespoons oil in a large skillet over medium; cook onions 15 to 20 minutes until golden and caramelized, stirring occasionally. Set aside.
Coat bottom and sides of a 9x13-inch pan with 2 tablespoons oil.
Transfer dough to pan; gently stretch to fill, using oiled fingers if sticky.
Cover loosely with kitchen towel; rest 30 minutes until puffy.
Preheat oven to 425°F.
Deeply dimple entire surface with fingers; drizzle with 2 more tablespoons oil.
Scatter onions and rosemary evenly over top; sprinkle with flaky salt.
Bake 20 to 25 minutes until top is golden brown and edges crispy; cool in pan 10 minutes before slicing and serving.