It is not recommended to clean a window air conditioner while it is still in the window. This is because the water from the cleaning process can drip down the side of the unit and into the window frame. This can cause mold and mildew growth, which can damage the window frame and the AC unit itself.
If you must clean a window air conditioner while it is still in the window, be sure to use a mild detergent and water solution. Do not use any harsh chemicals, as these can damage the unit. Also, be sure to wipe down the unit thoroughly after cleaning, and allow it to dry completely before using it again.