tableflip/ipfs-companion

Name: ipfs-companion

Owner: TABLEFLIP

Description: Browser extension that simplifies access to IPFS resources

Forked from: ipfs-shipyard/ipfs-companion

Created: 2017-11-15 10:21:05.0

Updated: 2018-04-23 13:29:10.0

Pushed: 2018-04-23 13:29:09.0

Homepage:

Size: 2978

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

IPFS Companion

demo of v2.2.0

js-standard-style localization status build-status
#ipfs-in-web-browsers

Browser extension that simplifies access to IPFS resources

Table of Contents
Background

This add-on enables everyone to access IPFS resources the way they were meant: from locally running IPFS node :-)

IPFS is a new hypermedia distribution protocol, addressed by content and identities. IPFS enables the creation of completely distributed applications. It aims to make the web faster, safer, and more open.

Learn more at ipfs.io (it is really cool, we promise!)

Features
Automagical Detection of IPFS Resources

Requests for IPFS-like paths (/ipfs/$cid or /ipns/$peerid_or_fqdn-with-dnslink) are detected on any website.
If tested path is a valid IPFS address it gets redirected and loaded from a local gateway, e.g:
https://ipfs.io/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
? http://127.0.0.1:8080/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR

IPFS API as window.ipfs

Your IPFS node is exposed as window.ipfs on every webpage. Websites can detect if window.ipfs exists and opt-in to use it instead of creating their own js-ipfs node. It saves system resources and battery (on mobile), avoids the overhead of peer discovery/connection, enables shared repository access and more! Make sure to read our notes on window.ipfs, where we explain it in-depth and provide examples on how to use it your own dapp.

Embedded js-ipfs Node

The Browser Action menu provides a toggle for switching between embedded, in-memory js-ipfs and external IPFS node accessed over HTTP API. The embedded node is great for quickly sharing files with someone, or for testing a dapp that uses window.ipfs without having to install and start up your own IPFS daemon.
Power users can provide own config (eg. to enable experimental pubsub) via Preferences.

Note: The embedded node does not run when external node is selected. Every time you switch back to the embedded node, a new instance is created on-demand. It can take a few seconds for a brand-new node to find peers.

IPFS Status and Context Actions Experiments!

(some are disabled by default, use Preferences screen to enable)

Install
Release Channel

We recommend installing the stable release via your browser's add-on store.

| Firefox | Chrome / Chromium | |————————————————————————————————————————————————————|————————————————————————————————————————————————————————————————| | Install From AMO | Install from Chrome Store |

Note: ipfs-companion is designed to retrieve content from a locally running IPFS daemon.
Make sure IPFS is installed on your computer.

Beta Channel

Developers and enthusiasts can opt-in for Beta-quality channel with hand-picked Dev Builds:

It is also possible to grab the last successful build from master, but these builds are not signed nor will automatically update: .zip bundles are meant only to be manually loaded via chrome://extensions (Chrome) or about:debugging (Firefox) for the purpose of quick smoke-testing.

Development

To work on the extension you need to install it from source rather than from the add on store.

  1. Clone https://github.com/ipfs-shipyard/ipfs-companion.git

  2. Build it:

    install
    run build    
    run bundle:generic # for Chrome dev
    
    run bundle:firefox # for Firefox dev (build default)
    
  3. Load it into browser:

    • Chromium-based

      1. Enter chrome://extensions in the URL bar
      2. Enable “Developer mode”
      3. Click “Load unpacked extension…”
      4. Pick the directory add-on
    • Firefox

      1. Enter about:debugging in the URL bar
      2. Check “Enable add-on debugging”
      3. Click “Load Temporary Add-on”
      4. Pick the file add-on/manifest.json

See docs/developer-notes.md for more detailed instructions

Reproducible Build in Docker

Want to ensure prebuilt bundle does not include any additional code?
Don't want to install JS dependencies such as NodeJS and yarn?

Do an isolated build inside of Docker!

Run the following commands for ending up with a built extension inside the build/ directory.

er build -t ipfs-companion .
er run -it -v $(pwd)/build:/usr/src/app/build ipfs-companion yarn ci:build

Now you can install the extension directly from build/

Legacy Firefox (< 53) and XUL-Compatible Browsers

Legacy versions 1.x.x were based on currently deprecated Add-On SDK (Firefox-only).
While it is not maintained anymore, one can inspect, build and install it using codebase from legacy-sdk branch.
For historical background on the rewrite see Issue #20: Move to WebExtensions.

Brave

See docs/brave.md

Contribute

Feel free to join in. All welcome. Open an issue!

If you want to help in developing this extension, please see CONTRIBUTING page :sparkles:

The browser extension team hangs out at the #ipfs-in-web-browsers channel on Freenode.

This repository falls under the IPFS Code of Conduct.

TROUBLESHOOTING

The best place to ask your questions about IPFS in general, how it works and what you can do with it is at discuss.ipfs.io.
We are also available at the #ipfs channel, where most of IPFS community hangs out.

Upload via Right-Click Does Not Work in Firefox

See this workaround.

Workaround for HTTP Redirect to Work with Ghostery

Ghostery is known to toy with HTTP-to-HTTPS redirect, which in some setups breaks websites utilizing public gateways. More details in #466. Until it is fixed upstream, a workaround is to whitelist affected site.

Rule to Work with NoScript with ABE Enabled

By default NoScript breaks this addon by blocking assets loaded from IPFS Gateway running on localhost.
To make it work, one needs to extend the SYSTEM Rulset and prepend it with IPFS whitelist:

able IPFS redirect to LOCAL
 ^http://127.0.0.1:8080/(ipfs|ipns)*
ymize

event Internet sites from requesting LAN resources.
 LOCAL
pt from LOCAL

Feel free to modify it, but get familiar with ABE rule syntax first.

License

IPFS logo belongs to The IPFS Project and is licensed under a CC-BY-SA 3.0.

is-ipfs, js-multihash and other NPM dependencies are under MIT license, unless stated otherwise.

The add-on itself is released under CC0: to the extent possible under law, the author has waived all copyright and related or neighboring rights to this work, effectively placing it in the public domain.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.