diff --git a/app/extensions.js b/app/extensions.js index f73df408a6c..32c522ff6f5 100644 --- a/app/extensions.js +++ b/app/extensions.js @@ -248,24 +248,32 @@ let generateIPFSManifest = () => { } return { - name: 'IPFS Viewer', - description: l10n.translation('ipfsDesc'), + // https://developer.chrome.com/extensions/manifest + // Required manifest_version: 2, - version: '1.0', + name: 'IPFS', + version: '0.1.0', + // Recommended + default_locale: 'en', + description: l10n.translation('ipfsDesc'), + icons: { + 128: 'img/ipfs-128.png', + 48: 'img/ipfs-48.png', + 16: 'img/ipfs-16.png' + }, + // Other + background: { + scripts: [ 'gen/ipfs.entry.js' ] + }, content_security_policy: concatCSP(cspDirectives), content_scripts: [], permissions: ['externally_connectable.all_urls', 'tabs', ''], externally_connectable: { matches: [''] }, - icons: { - 128: 'img/ipfs-128.png', - 48: 'img/ipfs-48.png', - 16: 'img/ipfs-16.png' - }, - incognito: 'split', - // TODO(diasdavid) How to get this key?? - key: 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyWl+wMvL0wZX3JUs7GeZAvxMP+LWEh2bwMV1HyuBra/lGZIq3Fmh0+AFnvFPXz1NpQkbLS3QWyqhdIn/lepGwuc2ma0glPzzmieqwctUurMGSGManApGO1MkcbSPhb+R1mx8tMam5+wbme4WoW37PI3oATgOs2NvHYuP60qol3U7b/zB3IWuqtwtqKe2Q1xY17btvPuz148ygWWIHneedt0jwfr6Zp+CSLARB9Heq/jqGXV4dPSVZ5ebBHLQ452iZkHxS6fm4Z+IxjKdYs3HNj/s8xbfEZ2ydnArGdJ0lpSK9jkDGYyUBugq5Qp3FH6zV89WqBvoV1dqUmL9gxbHsQIDAQAB' + incognito: 'split' + // https://developer.chrome.com/apps/manifest/key + // key: '' } } diff --git a/js/ipfs/entry.js b/js/ipfs/entry.js index 46d291a3b10..ea0836c66c4 100644 --- a/js/ipfs/entry.js +++ b/js/ipfs/entry.js @@ -1,3 +1,7 @@ // const ipc = window.chrome.ipcRenderer console.log('woot! managed to capture the ipfs:// or dweb:// protocols') + +chrome.protocol.registerStringProtocol('ipfs', (request, callback) => { + callback('hi there!') // eslint-disable-line +}) diff --git a/webpack.config.js b/webpack.config.js index ff9323c3b71..e747b815970 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -161,7 +161,7 @@ var webtorrentPage = { } } -var ipfsPage = { +var ipfs = { name: 'ipfs', target: 'web', entry: ['./js/ipfs/entry.js'], @@ -177,5 +177,5 @@ module.exports = [ merge(app, envConfig()), merge(devTools, envConfig()), merge(webtorrentPage, envConfig()), - merge(ipfsPage, envConfig()) + merge(ipfs, envConfig()) ]