From d6511cbcda36c152035afed66583c508d2eff498 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Sun, 5 Apr 2020 18:09:39 +0200 Subject: [PATCH] refactor: stop injecting window.Buffer Closes #637 --- add-on/src/contentScripts/ipfs-proxy/page.js | 4 ---- docs/window.ipfs.md | 2 -- 2 files changed, 6 deletions(-) diff --git a/add-on/src/contentScripts/ipfs-proxy/page.js b/add-on/src/contentScripts/ipfs-proxy/page.js index bc4c82485..94537966e 100644 --- a/add-on/src/contentScripts/ipfs-proxy/page.js +++ b/add-on/src/contentScripts/ipfs-proxy/page.js @@ -1,6 +1,5 @@ 'use strict' -const _Buffer = Buffer const { assign, freeze } = Object // TODO: (wip) this should not be injected by default into every page, @@ -46,7 +45,4 @@ function createWindowIpfs () { return freeze(proxyClient) } -// TODO: we should remove Buffer and add support for Uint8Array/ArrayBuffer natively -// See: https://github.com/ipfs/interface-ipfs-core/issues/404 -window.Buffer = window.Buffer || _Buffer window.ipfs = window.ipfs || createWindowIpfs() diff --git a/docs/window.ipfs.md b/docs/window.ipfs.md index bfbe4548b..b1c292087 100644 --- a/docs/window.ipfs.md +++ b/docs/window.ipfs.md @@ -68,8 +68,6 @@ if (window.ipfs && window.ipfs.enable) { } ``` -Note that IPFS Companion also adds `window.Buffer` if it doesn't already exist. - See also: [How do I fallback if `window.ipfs` is not available?](#how-do-i-fallback-if-windowipfs-is-not-available) ### Error Codes