Many track types support a data URI in the url fields. The data uri contains the compressed, uuencoded, content of a supported file type.
Most file formats are supported, with the exception of bigwig, bigbed, and tdf.
To produce a data URI from a data file
- gzip the data file, unless it is a bam file.
- base64 encode the contents of the gzipped or bam file
- do the following character replacements on the encoded string
`encoded.replace(/\+/g, '.').replace(/\//g, '_').replace(/=/g, '-')
- construct a data URI as follows
data:application/gzip;base64,<encoded string>
See https://github.com/igvteam/igv.js-reports for a utility to produce self-contained html files with an embedded igv.js viewer using data URIs.