Did I just almost start an oil fire? I wanted to make some burned onion rings, so I chopped up some onions and let it cook in oil on the stove. Heating the oil was taking a long time so I decided to leave the oven alone for a bit.

I came back after hearing the oil making crackling sounds and I immediately turned off the heat. When I lifted the lid slightly to assess what had happened, the oil suddenly started crackling again violently. 

Did I just almost start a fire? As I understand, there can be no fire without oxygen, and by lifting the metal lid I introduced oxygen. Also my entire house smells like smoke.
When you lift the lid on something that's been fryed in hot oil while the oil's still hot, any water that's cooked out of the oil and condensed on the lid has a chance to fall back into the oil. That can cause violent spattering. Usually being gentle in lifting is enough to prevent the problem.