diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index b2fe573ca..ad18b41d3 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -287,11 +287,8 @@ module.exports = { sidebarDepth: 1, collapsable: false, children: [ - 'how-to/companion-android-firefox', - 'how-to/companion-developer-notes', 'how-to/companion-node-types', 'how-to/dnslink-companion', - 'how-to/companion-localization', 'how-to/companion-window-ipfs', '/how-to/companion-x-ipfs-path-header' ] diff --git a/docs/how-to/companion-android-firefox.md b/docs/how-to/companion-android-firefox.md deleted file mode 100644 index cbf2b48f3..000000000 --- a/docs/how-to/companion-android-firefox.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: Firefox on Android -description: Instructions for installing and using IPFS Companion on Firefox for Android. ---- - -# Using IPFS Companion on Firefox for Android - -Firefox for Android is capable of running the same extensions as the desktop version. This makes it very useful for experimenting with IPFS. - -## Install Firefox for Android - -All channels are available at Google Play Store: - -- [Latest stable](https://play.google.com/store/apps/details?id=org.mozilla.firefox&hl=en) -- [Latest beta](https://play.google.com/store/apps/details?id=org.mozilla.firefox_beta) -- [Nightly](https://play.google.com/store/apps/details?id=org.mozilla.fennec_aurora) - -## Install IPFS Companion - -For full installation instructions, see [`README/#install`](https://github.com/ipfs-shipyard/ipfs-companion#install) in the IPFS Companion repo. - -You can also test the latest code locally on an emulator, or via USB on your own device. See below for details. - -## Hot-deploy over USB - -To run your extension in [Firefox for Android](https://www.mozilla.org/en-US/firefox/mobile/), follow these instructions: - -- [Set up your computer and Android emulator or device](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Developing_WebExtensions_for_Firefox_for_Android#Set_up_your_computer_and_Android_emulator_or_device) (enable Developer Mode, USB debugging, etc.) - -Build everything, and switch `add-on/manifest.json` to the Fennec profile: - -```bash -npm run dev-build -npm run bundle:fennec -``` - -Then, with your device connected to your development computer, run: - -```bash -web-ext run -s add-on --target=firefox-android -``` - -It will list all connected devices with their IDs. If the list is empty, go back to the setup step and try again. - -Next, deploy your extension to the specific device: - -```bash -web-ext run -s add-on --target=firefox-android --android-device= -``` - -The first time you run this command, there may be a popup on your Android device asking if you want to grant access over USB. - -## Debugging in Firefox for Android - -The remote debug port will be printed to the console right after successful deployment: - -```bash -You can connect to this Android device on TCP port -``` - -The fastest way to connect is to open `chrome://devtools/content/framework/connect/connect.xhtml` in Firefox on the same machine you run `web-ext` from. - -## Further resources - -- [MDN: Developing extensions for Firefox for Android](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Developing_WebExtensions_for_Firefox_for_Android) diff --git a/docs/how-to/companion-developer-notes.md b/docs/how-to/companion-developer-notes.md deleted file mode 100644 index 646eac52e..000000000 --- a/docs/how-to/companion-developer-notes.md +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: Developer notes -description: Developer notes for IPFS Companion, including building and running from source in Firefox, Chromium, and Android. ---- - -# IPFS Companion developer notes - -If you're looking to develop on IPFS Companion, you should build the project from source. - -## Build from source - -You will need [NodeJS](https://nodejs.org/) and [Firefox](https://www.mozilla.org/en-US/firefox/developer/). Make sure `npm` and `firefox` are in your `PATH`. You can use `yarn` instead of `npm`. We provide `yarn.lock` if you choose to do so. This guide assumes you are using NPM. - -1. Clone the [`ipfs-shipyard/ipfs-companion` repository](https://github.com/ipfs-shipyard/ipfs-companion): - - ```bash - git clone https://github.com/ipfs-shipyard/ipfs-companion.git - ``` - -2. Install all the project dependencies. This may take a few minutes: - - ```bash - npm install - - > ... - > added 4831 packages from 3074 contributors and audited 34257 packages in 265.081s - ``` - -3. Build, test, and run the project in Firefox: - - ```bash - npm start - - > ipfs-companion@ start /Users/oli/Desktop/ipfs-companion - > run-s clean build test firefox - > ... - > - ``` - - If you run into issues, you can run each step manually to pinpoint where the process is failing: - - ```bash - npm run build - npm run test - npm run firefox - ``` - - It is also possible to load the extension manually. Enter `about:debugging` in the URL bar, and then click "Load Temporary Add-on" and point it at `add-on/manifest.json`. - -### Build and manual install in Chromium - -1. Clone the repository: - - ```bash - git clone https://github.com/ipfs-shipyard/ipfs-companion.git - ``` - -2. Build the project: - - ```bash - npm run build bundle:chromium - - > ipfs-companion@ build /Users/oli/Desktop/ipfs-companion - > run-s clean build:* "bundle:chromium" - > ... - ``` - -3. Open [`chrome://extensions`](chrome://extensions) in your browser. -4. Enable **Developer mode**. -5. Click **Load unpacked extension...** and select the **add-on** folder within your project folder. - -| Chrome "unpacked extension" | Firefox "temporary add-on" | -| --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| ![Installing ipfs-companion as an unpacked extension in chrome](./images/ipfs-companion-install-chrome-dev.gif) | ![Installing ipfs-companion as a temporary add on in firefox](./images/ipfs-companion-install-firefox-dev.gif) | - -## Useful tasks - -Each `npm` task can run separately, but most of the time, `dev-build`, `test`, and `fix:lint` are all you need. - -- `npm install`: Install all NPM dependencies -- `npm run build`: Build the add-on (copy external libraries, create `.zip` bundles for Chrome and Firefox) -- `npm run bundle:chromium`: Overwrite manifest and package a generic, Chromium-compatible version -- `npm run bundle:brave`: Overwrite manifest and package a Brave-compatible version requesting access to `chrome.sockets` -- `npm run bundle:firefox`: Overwrite manifest and package a Firefox-compatible version -- `npm run build:rename-artifacts`: Rename artifacts to include runtimes in filenames -- `npm run ci`: Run tests and build (with frozen `yarn.lock`) -- `npm test`: Run the entire test suite -- `npm run lint`: Read-only check for potential syntax problems (run all linters) -- `npm run fix:lint`: Try to fix simple syntax problems (run `standard` with `--fix`, etc.) -- `npm run lint:standard`: Run [Standard](http://standardjs.com) linter ([IPFS JavaScript projects default to standard code style](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md)) -- `npm run lint:web-ext`: Run [addons-linter](https://github.com/mozilla/addons-linter) shipped with `web-ext` tool -- `npm run firefox`: Run as temporary add-on in Firefox -- `npm run chromium`: Run as temporary add-on in Chromium -- `npm run get-firefox-nightly`: Fetch latest Firefox nightly build to `./firefox/` -- `npm run firefox:beta:add -- --update-link "https://host/path/to/file.xpi" file.xpi`: Add a manifest entry for new self-hosted beta for Firefox - -Release build shortcuts: - -- `npm run dev-build`: All-in-one: fast dependency install, build with yarn (updates yarn.lock if needed) -- `npm run beta-build`: Reproducible beta build in docker with frozen `yarn.lock` -- `npm run release-build`: Reproducible release build in docker with frozen `yarn.lock` - -## Other tips - -- You can switch to an alternative Firefox version by overriding your `PATH`: - - ```bash - export PATH="/path/to/alternative/version/of/firefox/:${PATH}" - ``` - -- [Using localization in IPFS Companion](companion-localization.md) (running browsers with specific locale, etc.) -- [Testing persistent and restart features (Mozilla)](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Testing_persistent_and_restart_features) diff --git a/docs/how-to/companion-localization.md b/docs/how-to/companion-localization.md deleted file mode 100644 index ec36fae52..000000000 --- a/docs/how-to/companion-localization.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: Localization -description: Guide to running IPFS Companion with specific locales, including how to contribute translations. ---- - -# Localization in IPFS Companion - -IPFS Companion supports running in specific locales, with translations provided by the community via Transifex. - -## Running Chrome with a specific locale - -Chrome comes with locales out of the box, so it is enough to set the proper env: - -```go -LANGUAGE=pl chromium --user-data-dir=`mktemp -d` -``` - -## Running Firefox with a specific locale - -Unless you've installed a locale-specific build, Firefox will have English only. If your build already has the locale you are interested in, skip step #2. - -1. Set `intl.locale.requested` in `about:config` or the command line via: - - ```bash - web-ext run --pref intl.locale.requested=pl - ``` - -2. Install your language pack from https://addons.mozilla.org/firefox/language-tools/ -3. Reload the browser extension; it should detect your new locale - -### Further resources - -- [Mozilla: Use Firefox in another language](https://support.mozilla.org/en-US/kb/use-firefox-interface-other-languages-language-pack#w_how-to-change-the-language-of-the-user-interface) -- [Mozilla: Locale Codes](https://wiki.mozilla.org/L10n:Locale_Codes) -- [Language Codes in Chromium Project](https://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc) - -## Contributing translations - -Internationalization in IPFS Companion (and all IPFS-related projects) depends on the contributions of the community. You can give back by contributing translations in your language(s)! Go to the [IPFS Companion Transifex page](https://www.transifex.com/ipfs/ipfs-companion/), send a request to join a specific language team, and start translating. You can also download raw files from Transifex, translate them in your own editor/tool and then upload them back there, but many people prefer using the simple and friendly Transifex GUI. - -If your language is not present in `add-on/_locales` yet, but is supported by mainstream browsers, please create a [new issue](https://github.com/ipfs/ipfs-companion/issues/new) requesting it. - -Don't worry if GitHub does not immediately reflect translations added at Transifex: New translations are merged manually before every release. Locale files at GitHub are often behind what is already translated at Transifex. It is a good idea to keep Transifex email notifications enabled to be notified about new strings to translate. diff --git a/docs/how-to/companion-window-ipfs.md b/docs/how-to/companion-window-ipfs.md index dc55d978b..5b0d5cb61 100644 --- a/docs/how-to/companion-window-ipfs.md +++ b/docs/how-to/companion-window-ipfs.md @@ -1,5 +1,5 @@ --- -title: Using Window.IFPS +title: Using `window.ipfs` description: Learn about exposing IPFS API in IPFS Companion via "window.ipfs". --- @@ -7,10 +7,14 @@ description: Learn about exposing IPFS API in IPFS Companion via "window.ipfs". Learn about exposing IPFS API in IPFS Companion via "window.ipfs". +::: danger + ## `window.ipfs` is currently disabled IPFS Companion 2.11 stopped injecting `window.ipfs`. It will be restored after the [move to JS API with async await and async iterables](https://github.com/ipfs-shipyard/ipfs-companion/issues/843), with a likely ETA of Q3 2020. This page is provided for reference only. +::: + ### Disclaimer There is a substantial amount of [ongoing work for this interface](https://github.com/ipfs-shipyard/ipfs-companion/issues/589). Want to help with shaping it? See [#589](https://github.com/ipfs-shipyard/ipfs-companion/issues/589) and [issues with the `area/window-ipfs` label](https://github.com/ipfs-shipyard/ipfs-companion/labels/area%2Fwindow-ipfs).