Had this with mine. Halfords do a pack of 'External double sided sticky pads' that come in little black squares.
Open the window and fold one in half around the edge of the glass that fits into the frame when the window is closed. Do this 1" from the top and 1" from the bottom then shut the window.
If you have any protruding outside the frame trim it off with a sharp craft knife. Job done.
You will of course have two neat little black rectangles on the glass with the windows open but they hardly notice and look professional if done neatly. The sticky side in the frame helps to stop the rattle too but is not sufficiently sticky to stop you from opening the window. When they wear just replace, you get about 50 in pack for about £3 mine have been on for 18 months with the original ones
HTH