Someone suggested that this may in fact be possible, but I don't know how to check and couldn't find more information via search engines. My question is about js-ipfs: I would like to know whether it can be embedded within websites themselves, rather than only provided by browser addons such as IPFS Companion.
This is important as I'm thinking of making an IPFS based site. The site itself may be hosted anywhere (Github pages, download and open index.html locally, or even on IPFS itself) but its functionality will require IPFS and the js-ipfs-api interface. For the site to be user friendly, it cannot ask every visitor to install go-ipfs on their computer... and although I could use gateway.ipfs.io that wouldn't provide essential functionalities like pinning or seeding.
It would be ideal if my site's index.html file could simply contain a tag that links to the core js-ipfs.js file (from say Github). Once this script is linked, the browser automatically learns how to start a js-ipfs node which will run for as long as a browser tab is open. My own script is spawned after that and uses js-ipfs-api commands to automatically download or add or pin files in the background.
This sounds too easy to be true, but I heard people saying it should be possible. Would such a thing at least work for all Chromium and Firefox users? Are there any limitations or security issues in having web pages spawn js-ipfs nodes in browsers? Thank you.