Float the DUT,not the Oscilloscope!
OR
Use the two channels of the 'scope in the so-called "Pseudo-Differential " configuration,with the two probes connected to the two sides of the mains---Earth clips not connected,& tied up out of harms way.
OR
Just measure between Active mains & the DUT earthed chassis ---In most cases this will give you an adequate idea of the waveform at this point.
You can then also check between Neutral & Earth.
Normally,you should see the full mains voltage present between Active & Earth,& very little voltage at all between Neutral & Earth.
Note: In the
special case of a
"240 volt outlet" in the USA,you will see 120 volts or thereabouts between EACH wire & the Earth.
This method may have problems if you are looking at high frequency artifacts,due to the long connection between where you are and the Earth & Neutral connection at the mains entry point of the building.
In that case,the best thing is to float the DUT,using an isolation transformer,although the transformer will also have an effect on high frequency signal components.
There are no "perfect" solutions to this problem,except for a 'scope
designed for this work,where the input circuits will be fully isolated.
I don't know that I would trust the isolation of any of the "El Cheapo" 'scopes advertised as having isolated inputs!