Heat the oil in a preserving pan, add the onions and fry for 5 minutes, until softened. Stir in the tomatoes and chillies, then add the remaining ingredients.
Cook, uncovered, for 1 hour, stirring more frequently towards the end of cooking as the relish thickens.
Ladle into warm, dry jars, pressing down well and filling the jars to the top. Disperse any air pockets with a skewer or small knife and cover with screw-top lids. Label and leave to mature in a cool, dark place for at least 3 weeks.
To serve, this relish goes well with Chinese-style pancake rolls, prawn sesame toast and tiny dumplings.