fix: avoid window.ipfs in non-HTML context
fix: avoid window.ipfs in non-HTML context

Injecting proxy into application/xml produced malformed XML and SVG files.
This adds some sanity-checks and ensures injection happens only in HTML
contexts. It also improves performance by avoiding unnecessary port creation.

lidel/ipfs-firefox-addon,lidel/ipfs-firefox-addon,lidel/ipfs-firefox-addon