Lawmakers have given final approval to a measure that forces those convicted of domestic abuse to give up their guns.