I think using https prevents that, but not all sites can do https.
It is not quite clear what kind of "active content revealing my real IP" you are referring to but my guess is that you mean WebRTC which can be used to determine the public visible IP address. In this case use a browser which has no support for WebRTC or has disabled it. The TOR browser is a good choice in this regard.
Apart from that various other information leaks might reveal your public IP address, depending on the type and setup of VPN you are using. If for example your are only using some application level "VPN" (like the one built into the Opera browser) your IP address might be revealed by applications not using this "VPN", by DNS lookups or simply because IPv6 traffic is not done through the VPN.
The only thing that will commonly happen when setting up a VPN is that the DNS requests may still go directly to your ISP.