We propose an analytical pupil phase function employing cropped secondary astigmatism for extended-depth nanoscale 3D-localization microscopy. The function provides high localization precision in all three dimensions, which can be maintained over extended axial ranges, customizable up to two orders of magnitude relative to the conventional, diffraction-limited imaging. This enables, for example, capturing nanoscale dynamics within a whole cell. The flexibility and simplicity in the implementation of the proposed phase function make its adoption in localization-based microscopy attractive. We demonstrate and validate its application to real-time imaging of 3D fluid flow over a depth of 40 µm with a numerical aperture of 0.8.