We describe a new method of detecting electromagnetic radiation, operating across a broad frequency range and at least up to liquid nitrogen temperatures. The method is based on the excitation of a special type of plasma waves -- edge magnetoplasmons -- in a semiconductor structure with an embedded two-dimensional (2D) electron layer. Irradiation of the sample by electromagnetic waves induces a photovoltage (or a photoresistance) between pairs of contacts to the 2D electron gas, which oscillates as a function of an applied magnetic field. The amplitude and the period of the oscillations are proportional to the radiation power and the wavelength respectively, allowing one to use the device as a detector and spectrometer of radiation. Successful operation of such a detector/spectrometer has been experimentally demonstrated in GaAs-AlGaAs quantum-well structures at microwave frequencies from 20 GHz up to ~150 GHz and at temperatures up to ~80 K. We do not expect any principal difficulties in extending the operating frequency range into the terahertz region. The sample design is very simple and does not require submicron technology.