-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced console.log calls with 'debug'-based logging. Different parts of extension and JS IPFS stack log to own namespaces, and user can tweak which logs should be printed to Browser Console using input on Preferences screen.
- Loading branch information
Showing
15 changed files
with
97 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
'use strict' | ||
/* eslint-env browser, webextensions */ | ||
|
||
// Enable some debug output from js-ipfs | ||
// (borrowed from https://github.com/ipfs-shipyard/ipfs-companion/pull/557) | ||
// to include everything (mplex, libp2p, mss): localStorage.debug = '*' | ||
localStorage.debug = 'jsipfs*,ipfs*,-*:mfs*,-*:ipns*,-ipfs:preload*' | ||
|
||
const browser = require('webextension-polyfill') | ||
const createIpfsCompanion = require('../lib/ipfs-companion') | ||
const { onInstalled } = require('../lib/on-installed') | ||
const { optionDefaults } = require('../lib/options') | ||
|
||
// register onInstalled hook early, otherwise we miss first install event | ||
browser.runtime.onInstalled.addListener(onInstalled) | ||
|
||
// init add-on after all libs are loaded | ||
document.addEventListener('DOMContentLoaded', async () => { | ||
// setting debug level early | ||
localStorage.debug = (await browser.storage.local.get({ debugNamespaces: optionDefaults.debugNamespaces })).debugNamespaces | ||
// init inlined to read updated localStorage.debug | ||
const createIpfsCompanion = require('../lib/ipfs-companion') | ||
window.ipfsCompanion = await createIpfsCompanion() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.