I always mask the canopy, inside and out, and then paint the inside of the canopy frame with whatever color is appropriate for the interior of the aircraft I'm modeling. Don't use primer on the inside, because it will show through to the outside edges of the frame. After that, at some point I will attach the still-masked canopy to the model (usually temporarily with a thin snake of Blue Tack to stick it in place AND keep atomized paint from sneaking inside the cockpit and fouling all of the intricate detail). Then my primer goes on the whole model, including the outside of the canopy. All of my final fine-tuning of seams and panel lines is then done, before another thin coat of primer (mostly just to the areas I fine-tuned to confirm the job is complete). Then the paint/camo pattern/counter-shading goes on. Then clear-coating, decaling, Flory wash, final clear coat, etc...then the temporarily mounted canopy comes off and gets unmasked. I attach the canopy parts to the fuselage and/or canopy rails using clear epoxy.
As far as what to use for masking the canopy goes, I use tape or Tamiya masking sheet material along the edges of the frame for a sharp edge and then fill in the larger areas with liquid mask. If you put your primer and paint on nice and thin, you shouldn't have any trouble with paint chipping along the edges when you remove the mask after the paint has dried all that time. Just airbrush your paint either completely perpendicular to the masking line or angled toward the non-masked areas. Don't point the airbrush at the edge of the masking, or paint can build up along the edge and can bleed underneath. Doing it that way and building a ridge can also lead to chipping when you remove the mask.
Since I am now on my 5th model since my almost 25 year hiatus from building, and my 4th was an F-16CJ, I have no experience with getting a nice smooth transition between the fuselage and a front windscreen. But, for that on my Su-25, I think I'll be using Milliput. Its a two part epoxy-type putty that can easily be smoothed flush with a damp Q-Tip before it cures and has a nice, long working time. No solvents, so it won't craze the clear plastic, and I shouldn't need to get sandpaper anywhere near it.
Here's a fairly-decent pic of the finished F-16CJ canopy. Used the same method (with pre-cut Eduard masking sheets and liquid mask) to get the rubber strip around the canopy.