  The dispersion measure (DM)--redshift relation of fast radio bursts (FRBs)
has been proposed as a potential new tool for probing intergalactic medium
(IGM) and for studying cosmology. However, the poor knowledge of the baryon
fraction in the IGM ($f_{\mathrm{IGM}}$) and its degeneracy with cosmological
parameters impose restrictions on the cosmological applications of FRBs.
Furthermore, DMs contributed by the IGM ($\mathrm{DM_{IGM}}$) and host galaxy
($\mathrm{DM_{host}}$), important cosmological quantities, cannot be exactly
extracted from observations, which would bring uncontrolled systematic
uncertainties in FRB cosmology. In this work, we use seventeen localized FRBs
to constrain $f_{\mathrm{IGM}}$ and its possible redshift evolution. Other
cosmological probes such as type Ia supernovae, baryon acoustic oscillations,
and cosmic microwave background radiation are combined to break parameter
degeneracy. Taking into account the probability distributions of
$\mathrm{DM_{IGM}}$ and $\mathrm{DM_{host}}$ derived from the the IllustrisTNG
simulation, we obtain a robust measurement of $f_{\mathrm{IGM}}=0.927\pm0.075$,
representing a precision of 8.0\%. We find that there is no strong evidence for
the redshift dependence of $f_{\mathrm{IGM}}$ at the current observational data
level. The rapid progress in localizing FRBs will significantly improve the
constraints on $f_{\mathrm{IGM}}$.
