Set a small skillet over medium heat. Lay the chiles and garlic in the skillet and dry-roast until soft and blotchy black in spots, about 15 minutes for the garlic, about 10 minutes for the chile.
While the chiles and garlic are roasting, scoop the chopped onion into a strainer and rinse under cold water. Shake off the excess water and pour into a medium bowl.
Pull the stems off the roasted chiles and peel the papery skins off the garlic. Scoop them into a food processor and pulse until they are finely chopped. Add the tomatoes with their juice, re-cover and pulse a few more times until the mixture is as coarse or smooth as you want your salsa to be.
Pour the tomato mixture in with the onion. Add the cilantro, stir thoroughly. Thin with a little water if necessary to give the salsa an easily spoonable consistency. Taste and season with the lime juice or vinegar and salt, usually about ½ teaspoon. If not using within an hour or two, cover and refrigerate. If you’re not planning to use the salsa within a few hours, wait until you’re ready to serve to add the onions and cilantro.