Preheat all burners on gas grill to medium heat, and soak wooden skewers in water for 10 minutes.
Peel the papery skins off the onions.
Put your onion onto a cutting board so that the middle of the onion is on the board, with the root and stem facing outwards. Cut off the root and stem. Then cut 1/2 inch to 3/4 inch slices of the onion.
Lay those slices flat on the cutting board, and drive your skewer through the center of the bottom of the slice, and run it all the way through so it come out the top. Repeat with all slices!
Brush both sides of onions with olive oil and sprinkle with salt.
Turn one burner off, and set onions directly on that grate. Close lid and cook for 10-15 minutes, then flip onions and brush top side with more olive oil to keep them moist. Close lid and cook for 10-15 minutes. Then assess and if you'd like the onions a bit softer, cook for 5 more minutes.
Remove from grill and put on plate. You can keep on the skewer, or slide the onions off once they've cooled a bit. Then spoon pesto over the top and use a spoon to distribute, so that the pesto soaks into the onions.