Welcome to mirror list, hosted at ThFree Co, Russian Federation.

background.js « lib - github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a2c42bd8cbbccf39a61f8fabd367ce9a7127b9d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var TorrentManager = require('./TorrentManager')

module.exports = function () {

  var manager = new TorrentManager()

  // manager.add('magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&dn=Leaves+of+Grass+by+Walt+Whitman.epub')

  manager.on('error', function (err) {
    console.error(err)
    // TODO: Show error in UI somehow
  })

  var mainWindow

  chrome.app.runtime.onLaunched.addListener(function () {
    chrome.app.window.create('app.html', {
      bounds: {
        width: 500,
        height: 600
      },
      frame: 'none',
      id: 'app',
      minWidth: 350,
      minHeight: 165
    }, function (_mainWindow) {
      mainWindow = _mainWindow
      mainWindow.contentWindow.name = 'app'
      // TODO: on add/remove torrent call resizeTo to set window size

    })
  })
}