Giter Site home page Giter Site logo

decentered / ipfs-companion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ipfs/ipfs-companion

0.0 2.0 0.0 1.41 MB

Browser extension that simplifies access to IPFS resources

License: Creative Commons Zero v1.0 Universal

Makefile 1.14% HTML 1.38% JavaScript 88.45% CSS 8.22% Shell 0.81%

ipfs-companion's Introduction

IPFS Companion

demo of v2.0.13

js-standard-style localization status Coverage 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 resources at IPFS-like paths (/ipfs/$cid or /ipns/$peerid_or_fqdn) 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 Status and Action Menu

  • IPFS API and Gateway status
  • Quick Upload of local files
  • Easy access to WebUI and add-on Preferences
  • Toggle redirection to local gateway (automatic by default, manual mode can be enabled in Preferences)
  • Additional actions for pages loaded from IPFS
    • Pin/Unpin of IPFS resources (via API)
    • Copy canonical IPFS address
    • Copy shareable URL to resource at preferred public gateway

Experiments!

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

  • Requests made via experimental protocols are re-routed to HTTP gateway (public or custom):
    • ipns://$cid
    • ipns://$cid_or_fqdn
    • dweb:/ipfs/$cid
    • dweb:/ipns/$cid_or_fqdn
  • Detect domains with dnslink in DNS TXT record and load them from IPFS
  • Make plaintext IPFS links clickable
  • Mirror to IPFS by right click on any image or video

Install

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

Firefox Chrome / Chromium
Get the add-on

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

Modern Firefox (> 53)

Install the latest signed release from AMO.

It will guarantee automatic updates to the latest version reviewed by Mozilla community.

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.

Chrome / Chromium

Install the latest signed release from Chrome Web Store.

Development or other Browsers Supporting WebExtensions API

Try manual installation:

  1. Download Sources

  2. Build it:

    npm install
    npm run build
  3. Load it into browser:

    • Chromium-based
      1. Enter chrome://extensions in the URL bar
      2. Enable "Developer mode"
      3. Click "Load unpacked extension..." and point it at add-on/manifest.json
    • Firefox
      1. Enter about:debugging in the URL bar
      2. Click "Load Temporary Add-on" and point it at add-on/manifest.json

Brave

ipfs-companion works in Brave. To try it out today you need to run brave from source, but we are working with Brave to get seamless IPFS support working out of the box. Track our progress here

  • Configure your local ipfs gateway to run on port 9090 (the default, port 8080, conflicts with the brave webpack dev server)
  • Clone and build ipfs-companion as above
  • Clone brave/browser-laptop
  • Symlink the ipfs-companion/add-on dir to browser-laptop/app/extensions/ipfs
  • Add the following to browser-laptop/app/extensions.js
  // Enable IPFS
  extensionInfo.setState('ipfs', extensionStates.REGISTERED)
  loadExtension('ipfs', getExtensionsPath('ipfs'), undefined, 'component')

https://github.com/ipfs-shipyard/browser-laptop/blob/66f38870fced0dbc55aae7fe1ed905bff602f88e/app/extensions.js#L500-L502

Brave will start up and you should see a badge with your number of connected ipfs peers next to the brave button, top right. (the ipfs-companion badge currently doesn't appear issue, pr). Click on the badge and update your gateway settings to use port 9090, then go share something with your peers...

brave ipfs

Enable Embedded IPFS Support via js-ipfs

We are testing out embedding an ipfs node in the add-on background page. It's hidden by default currently.

To enable it, edit the package.json file to remove...

  "ipfs": false

...from the browser section and run npm run build. Note, don't set it to true, as that's not how the browser module stubbing works

Contribute

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

If you want to help in developing this extension, please see CONTRIBUTING page โœจ

This repository falls under the IPFS Code of Conduct.

TROUBLESHOOTING

Upload via Right-Click Does Not Work in Firefox

See this workaround.

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:

# Enable IPFS redirect to LOCAL
Site ^http://127.0.0.1:8080/(ipfs|ipns)*
Anonymize

# Prevent Internet sites from requesting LAN resources.
Site LOCAL
Accept from LOCAL
Deny

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.