Repairing scratches in window glass

Anyone ever done this successfully? I’m talking about fairly shallow surface scratches, not cracks. These are only a few inches long. I see advice on using toothpaste or buying a commercial product (car windshield repair kits usually) when googling.