Preheat oven to 350°F. Line a 9x13-inch pan with foil (leave an overhang for easy lifting) and spray the foil with cooking spray.
In the bowl of a stand mixer fitted with the paddle attachment (or in a bowl with a hand mixer), combine 1 cup softened unsalted butter, 2 cups all-purpose flour, 1/2 cup powdered sugar, and 1/2 teaspoon salt. Mix until a smooth shortbread dough forms, stopping to scrape the bowl as needed.
Transfer the dough to the prepared pan. Spray your hands with cooking spray and press the dough into an even, thin layer across the bottom and slightly up the sides of the pan.
Bake the crust in the preheated oven for 15 minutes, until it is set and the edges begin to firm.
While the crust is baking, whisk together 1 can (14 ounces) sweetened condensed milk, 1 large egg, and 1 teaspoon coconut extract in a medium bowl until smooth. Stir in 2 cups shredded sweetened coconut until evenly combined.
After the crust has baked 15 minutes, remove the pan from the oven and carefully pour the coconut mixture evenly over the hot crust. Spread gently if needed to distribute the filling.
Return the pan to the oven and bake an additional 17–19 minutes, until the filling is set and the edges are golden brown (the center may be slightly soft but should not be liquid).
Remove the pan from the oven and cool completely on a wire rack. Use the foil overhang to lift the bars from the pan, then cut into squares once fully cooled.
Store the bars in an airtight container for up to 3 days, or freeze for up to one month.
Notes
9. Store the bars in an airtight container for up to 3 days, or freeze for up to one month.