This is not safe. Lids "pop" from any temperature change. You could "can" anything this way but that would not make it safe. What you did/want to do is called "open kettle canning" and is not a safe canning method.
Why is open kettle canning not recommended?
In open kettle canning, food is cooked in an ordinary kettle, then packed into hot jars and sealed without processing. The temperatures obtained in open kettle canning are not high enough to destroy all spoilage and food poisoning organisms that may be in the food. Also, microorganisms can enter the food when it is transferred from the kettle to jar and cause spoilage.
Also, when canning properly (including a waterbath step of 10 minutes or more) sterilizing jars is an unnecessary step in the process as the processing step essentially sterilizes them along with everything inside them. (see below, same source as above)
Is it necessary to sterilize jars before canning?
Jars do not need to be sterilized before canning if they will be filled with food and processed in a boiling water bath canner for 10 minutes or more or if they will be processed in a pressure canner. Jars that will be processed in a boiling water bath canner for less than 10 minutes, once filled, need to be sterilized first by boiling them in hot water for 10 minutes before they're filled.
And lastly, canning is a science, not an art as cooking often is. It is not safe to just use any recipe off the internet/cookbook/granny. The ratio of low acid ingredients (peppers, onions, etc) to high acid ingredients (vinegar, citrus juice) to tomatoes (almost acidic to can on their own in a waterbath) is incredibly important to yield a safe product and is not something that should be guessed at. (See below, also same source as above)
Can I can my own salsa recipe?
Salsas are usually mixtures of acid and low-acid ingredients; they are an example of an acidified food. The specific recipe, and sometimes preparation method, will determine if a salsa can be processed in a boiling water canner or a pressure canner. A process must be scientifically determined for each recipe. To can salsa at home, use our recipes for Hot Chile Salsa or Mexican Tomato Sauce. Your county Extension agent may have additional tested recipes for salsas.
Of note and directly related to salsa is the requirement for added acid even when canning tomatoes plain. They are "borderline" acidic enough to can on their own in a waterbath, so additional acid must be added to push them into "definitely safe to waterbath". Many "pressure canner" times can be found for tomatoes and tomato products. For tomatoes this is a process that mimics the waterbath process under 5lb of pressure and is not a "true" pressure canning process. The tomatoes must still be properly acidified even if following the pressure canning directions for canning them.
Acidification: To ensure safe acidity in whole, crushed, or juiced tomatoes, add two tablespoons of bottled lemon juice or 1/2 teaspoon of citric acid per quart of tomatoes. For pints, use one tablespoon bottled lemon juice or 1/4 teaspoon citric acid. Acid can be added directly to the jars before filling with product. Add sugar to offset acid taste, if desired. Four tablespoons of a 5 percent acidity vinegar per quart may be used instead of lemon juice or citric acid. However, vinegar may cause undesirable flavor changes.
I highly advise reading through this website to learn the basics of safe canning, it also has MANY fantastic and safe recipes designed for canning: