Permalink
Browse files

Firefox compatibility and many improvements (#89)

* - Make extension compatible with Firefox
- Improve episode title detection

* Update extension.zip

* - Migrate to Webpack
- Add options menu
- Various fixes and improvements

* - Many bug fixes and enhancements
- Add PT-BR locale
- Fix tests
- Up version

* Update README.md

* - Fix collections detection

* Update README.md

* - Use Netflix API instead of scraping the HTML (close #1)

* - Improve loading time of activity history (closes #2)

* - Fix webpack.config

* - Rename config.json.dev to config.dev.json

* - Add Firefox to .travis.yml

* - Possible fix for Travis

* - Implement cache and database for history sync (close #3)
- Add option to disable scrobbling (close #4)

* - Improve error handling when updating item in history sync (close #5)

* - Make requests to the Netflix API using English (close #7)
- Disable sync checkbox if item was not found on Trakt (close #8)
- Make sure that when 'Select all' is toggled, items that are disabled are not checked (close #9)

* - v2.0.1

* - Fix a bug that only triggers the extension when installing/updating on Firefox (close #10)
- Migrate tests from Jasmine to Mocha + Chai (close #11)
- v2.0.2

* v2.0.3

* v2.0.4

-  Fix a bug that happens when updating shows (close #14)
  • Loading branch information...
gsrafael01 authored and tegon committed Dec 27, 2018
1 parent 7d6b4d3 commit fbc8807543826ac4454d97934944d7ac0f15b613
Showing with 8,046 additions and 3,487 deletions.
  1. +38 −0 .babelrc
  2. +36 −0 .eslintrc.json
  3. +3 −1 .gitignore
  4. +0 −25 .jshintrc
  5. +1 −1 .nvmrc
  6. +3 −5 .travis.yml
  7. +25 −12 README.md
  8. +217 −7 app/_locales/en/messages.json
  9. +224 −0 app/_locales/pt_BR/messages.json
  10. BIN app/{styles → }/fonts/Roboto-Regular.ttf
  11. +3 −5 app/history-sync.html
  12. BIN app/{images → img}/background.jpg
  13. BIN app/{images → img}/traktflix-icon-128.png
  14. BIN app/{images → img}/traktflix-icon-16.png
  15. BIN app/{images → img}/traktflix-icon-19.png
  16. BIN app/{images → img}/traktflix-icon-38.png
  17. BIN app/{images → img}/traktflix-icon-selected-19.png
  18. BIN app/{images → img}/traktflix-icon-selected-38.png
  19. +1 −0 app/js/background.js
  20. +1 −0 app/js/content.js
  21. +38 −0 app/js/history-sync.js
  22. +38 −0 app/js/options.js
  23. +38 −0 app/js/popup.js
  24. +1 −0 app/js/vendor.js
  25. +53 −51 app/manifest.json
  26. +21 −0 app/options.html
  27. +2 −4 app/popup.html
  28. +0 −23 app/scripts/src/background/analytics.js
  29. +0 −69 app/scripts/src/background/background.js
  30. +0 −35 app/scripts/src/chrome-storage.js
  31. +0 −138 app/scripts/src/content/content-controller.js
  32. +0 −20 app/scripts/src/content/content.js
  33. +0 −58 app/scripts/src/content/item-parser.js
  34. +0 −29 app/scripts/src/content/item.js
  35. +0 −95 app/scripts/src/content/scrobble.js
  36. +0 −96 app/scripts/src/content/search.js
  37. +0 −64 app/scripts/src/content/watch-events.js
  38. +0 −73 app/scripts/src/history-sync/components/activity-list-item.js
  39. +0 −26 app/scripts/src/history-sync/components/activity-list.js
  40. +0 −36 app/scripts/src/history-sync/components/trakt-url-form.js
  41. +0 −115 app/scripts/src/history-sync/components/viewing-activity-app.js
  42. +0 −10 app/scripts/src/history-sync/constants/activity-constants.js
  43. +0 −9 app/scripts/src/history-sync/history-sync.js
  44. +0 −88 app/scripts/src/history-sync/stores/activity-store.js
  45. +0 −99 app/scripts/src/history-sync/utils/netflix-web-api-utils.js
  46. +0 −158 app/scripts/src/history-sync/utils/trakt-web-api-utils.js
  47. +0 −93 app/scripts/src/oauth.js
  48. +0 −17 app/scripts/src/popup/components/about.js
  49. +0 −100 app/scripts/src/popup/components/app.js
  50. +0 −16 app/scripts/src/popup/components/button.js
  51. +0 −39 app/scripts/src/popup/components/header.js
  52. +0 −22 app/scripts/src/popup/components/info.js
  53. +0 −20 app/scripts/src/popup/components/loading.js
  54. +0 −31 app/scripts/src/popup/components/login-button.js
  55. +0 −13 app/scripts/src/popup/components/not-watching.js
  56. +0 −22 app/scripts/src/popup/components/watching.js
  57. +0 −25 app/scripts/src/popup/messages.js
  58. +0 −27 app/scripts/src/popup/popup.js
  59. +0 −41 app/scripts/src/request.js
  60. +0 −15 app/scripts/src/rollbar.js
  61. +0 −11 app/scripts/src/settings.js
  62. +0 −38 app/scripts/src/tmdb-image-container.js
  63. +0 −87 app/scripts/src/tmdb-image.js
  64. +0 −90 app/scripts/vendor/google-analytics-bundle.js
  65. +0 −10 app/scripts/vendor/material.min.js
  66. +0 −9 app/styles/src/loading.css
  67. +0 −10 app/styles/src/login.css
  68. +0 −8 app/styles/vendor/material.min.css
  69. config.json.dev → config.dev.json
  70. +17 −119 gulpfile.js
  71. +30 −57 karma.conf.js
  72. +57 −50 package.json
  73. BIN src/assets/fonts/Roboto-Regular.ttf
  74. BIN src/assets/images/background.jpg
  75. BIN src/assets/images/traktflix-icon-128.png
  76. BIN src/assets/images/traktflix-icon-16.png
  77. BIN src/assets/images/traktflix-icon-19.png
  78. BIN src/assets/images/traktflix-icon-38.png
  79. BIN src/assets/images/traktflix-icon-selected-19.png
  80. BIN src/assets/images/traktflix-icon-selected-38.png
  81. +16 −0 src/assets/index.js
  82. 0 {app/styles/src → src/assets/styles}/fonts.css
  83. 0 {app/styles/src → src/assets/styles}/history-card.css
  84. +20 −3 {app/styles/src → src/assets/styles}/history-sync.css
  85. +1 −1 {app/styles/src → src/assets/styles}/info-card.css
  86. +9 −6 {app/styles/src → src/assets/styles}/layout.css
  87. +10 −0 src/assets/styles/loading.css
  88. +8 −0 src/assets/styles/login.css
  89. +8 −0 src/assets/styles/material.min.css
  90. +2 −3 {app/styles/src → src/assets/styles}/watching-card.css
  91. +24 −0 src/class/Analytics.js
  92. +66 −0 src/class/ChromeStorage.js
  93. +30 −0 src/class/ErrorBoundary.js
  94. +28 −0 src/class/Item.js
  95. +38 −0 src/class/ItemParser.js
  96. +242 −0 src/class/NetflixApiUtils.js
  97. +110 −0 src/class/Oauth.js
  98. +44 −0 src/class/Request.js
  99. +43 −0 src/class/Rollbar.js
  100. +112 −0 src/class/Search.js
  101. +152 −0 src/class/content/ContentController.js
  102. +57 −0 src/class/content/EventWatcher.js
  103. +133 −0 src/class/content/Scrobble.js
  104. +26 −3 ...story-sync/actions/activity-action-creators.js → src/class/history-sync/ActivityActionCreators.js
  105. +41 −0 src/class/history-sync/ActivityList.js
  106. +127 −0 src/class/history-sync/ActivityListItem.js
  107. +117 −0 src/class/history-sync/ActivityStore.js
  108. +46 −0 src/class/history-sync/TraktURLForm.js
  109. +207 −0 src/class/history-sync/TraktWebAPIUtils.js
  110. +122 −0 src/class/history-sync/ViewingActivityApp.js
  111. +65 −0 src/class/options/OptionsActionCreators.js
  112. +37 −0 src/class/options/OptionsList.js
  113. +45 −0 src/class/options/OptionsListItem.js
  114. +84 −0 src/class/options/OptionsStore.js
  115. +47 −0 src/class/options/OptionsUtils.js
  116. +152 −0 src/class/options/ViewingOptionsApp.js
  117. +16 −0 src/class/popup/About.js
  118. +149 −0 src/class/popup/App.js
  119. +31 −0 src/class/popup/Button.js
  120. +59 −0 src/class/popup/Header.js
  121. +36 −0 src/class/popup/Info.js
  122. +33 −0 src/class/popup/Loading.js
  123. +56 −0 src/class/popup/LoginButton.js
  124. +11 −0 src/class/popup/NotWatching.js
  125. +31 −0 src/class/popup/Watching.js
  126. +122 −0 src/class/tmdb/TmdbImage.js
  127. +63 −0 src/class/tmdb/TmdbImageContainer.js
  128. +135 −0 src/modules/background/index.js
  129. +47 −0 src/modules/content/index.js
  130. +14 −0 src/modules/history-sync/activity-constants.js
  131. +12 −0 src/modules/history-sync/index.js
  132. 0 ...cripts/src/history-sync/dispatcher → src/modules/history-sync}/viewing-activity-app-dispatcher.js
  133. +13 −0 src/modules/options/index.js
  134. +13 −0 src/modules/options/options-constants.js
  135. +3 −0 src/modules/options/viewing-options-app-dispatcher.js
  136. +14 −0 src/modules/popup/index.js
  137. +34 −0 src/modules/popup/messages.js
  138. +2,340 −0 src/modules/vendor/google-analytics-bundle.js
  139. +1 −0 src/modules/vendor/index.js
  140. +13 −0 src/settings.js
  141. +34 −0 src/typedefs.js
  142. +0 −47 support/domparser-polyfill.js
  143. +0 −3 support/netflix-cast-player.js
  144. +0 −7 support/netflix-player.js
  145. +0 −39 support/netflix-viewing-activity.js
  146. +7 −0 test-helpers/EnzymeHelper.js
  147. +15 −0 test-helpers/NetflixTestHelper.js
  148. +34 −0 test/Analytics.js
  149. +99 −0 test/ChromeStorage.js
  150. +42 −0 test/ErrorBoundary.js
  151. +50 −0 test/Item.js
  152. +81 −0 test/ItemParser.js
  153. +180 −0 test/Oauth.js
  154. +262 −0 test/Search.js
  155. +219 −0 test/content/ContentController.js
  156. +38 −0 test/content/EventWatcher.js
  157. +200 −0 test/content/Scrobble.js
  158. +40 −0 test/popup/Button.js
  159. +40 −0 test/popup/Header.js
  160. +42 −0 test/popup/Info.js
  161. +34 −0 test/popup/Loading.js
  162. +81 −0 test/popup/LoginButton.js
  163. +51 −0 test/popup/Watching.js
  164. +0 −33 tests/background/analytics-test.js
  165. +0 −86 tests/chrome-storage-test.js
  166. +0 −131 tests/content/content-controller-test.js
  167. +0 −65 tests/content/item-parser-test.js
  168. +0 −30 tests/content/item-test.js
  169. +0 −103 tests/content/scrobble-test.js
  170. +0 −151 tests/content/search-test.js
  171. +0 −34 tests/content/watch-events-test.js
  172. +0 −157 tests/oauth-test.js
  173. +0 −24 tests/popup/components/button-test.js
  174. +0 −25 tests/popup/components/header-test.js
  175. +0 −32 tests/popup/components/info-test.js
  176. +0 −24 tests/popup/components/loading-test.js
  177. +0 −57 tests/popup/components/login-button-test.js
  178. +0 −43 tests/popup/components/watching-test.js
  179. +0 −56 tests/test-helper.js
  180. +133 −0 webpack.config.js
@@ -0,0 +1,38 @@
{
"env": {
"production": {
"presets": [
["minify",
{
"builtIns": false
}
]
]
},
"test": {
"plugins": [
[
"istanbul",
{
"include": [
"src/**/*.js"
]
}
]
]
}
},
"plugins": [
[
"@babel/plugin-transform-runtime",
{
"regenerator": true
}
]
],
"presets": [
"@babel/preset-env",
"@babel/preset-flow",
"@babel/preset-react"
]
}
@@ -0,0 +1,36 @@
{
"env": {
"browser": true,
"es6": true,
"mocha": true,
"node": true,
"webextensions": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"globals": {
"expect": false
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module"
},
"plugins": [
"mocha",
"sinon"
],
"rules": {
"no-console": "off",
"no-constant-condition": [
"error",
{
"checkLoops": false
}
],
"no-empty": "off",
"no-fallthrough": "off"
}
}
@@ -12,6 +12,8 @@ build
*.crx
*.pem
coverage
app.zip
config.json
.idea/
app.zip
src.zip
package-lock.json

This file was deleted.

Oops, something went wrong.
2 .nvmrc
@@ -1 +1 @@
v0.12.0
v10.11.0
@@ -1,8 +1,6 @@
language: node_js
node_js:
- "0.10"
- "0.11"
- "0.12"
script: "npm test"
- "node"
script: "xvfb-run npm test"
after_script:
- "cat ./coverage/**/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
- "cat ./coverage/**/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
@@ -10,13 +10,16 @@
</h1>


<h4 align="center">Netflix and trakt.tv integration.</h4>
<h4 align="center">A Trakt.tv scrobbler for Netflix.</h4>

<p align="center">
<a href="https://github.com/tegon/traktflix/releases"><img src="https://img.shields.io/github/release/tegon/traktflix.svg" alt="github release"></a>
<a href="https://travis-ci.org/tegon/traktflix"><img src="https://img.shields.io/travis/feross/webtorrent/master.svg" alt="travis"></a>
<a href="https://coveralls.io/github/tegon/traktflix?branch=master"><img src="https://coveralls.io/repos/tegon/traktflix/badge.svg?branch=master&service=github" alt="coveralls"></a>
<a href="https://chrome.google.com/webstore/detail/traktflix-netflix-and-tra/bmoemkaigjgcgjjnpmdgkifndiidkeji"><img src="https://img.shields.io/chrome-web-store/d/bmoemkaigjgcgjjnpmdgkifndiidkeji.svg" alt="downloads"></a>
<a href="https://github.com/gsrafael01/traktflix/releases"><img src="https://img.shields.io/github/release/gsrafael01/traktflix.svg" alt="github release"></a>
<a href="https://travis-ci.com/gsrafael01/traktflix"><img src="https://travis-ci.com/gsrafael01/traktflix.svg?branch=master" alt="travis"></a>
<a href='https://coveralls.io/github/gsrafael01/traktflix?branch=master'><img src='https://coveralls.io/repos/github/gsrafael01/traktflix/badge.svg?branch=master' alt='Coverage Status' /></a>
</p>

<p align=left">
<a href="https://addons.mozilla.org/en-US/firefox/addon/traktflix"><img src="https://discourse-paas-production-content.s3.amazonaws.com/original/3X/c/0/c03e12b8fae82e431eabaf0f6e250bfc78504182.png" alt="Get the add-on"></a>
</p>

### Table of Contents
@@ -32,8 +35,8 @@ Automatically scrobble TV show episodes and movies you are watching to Trakt.tv!

### Why do I need this extension?
Trakt.tv has a [lot of plugins](http://trakt.tv/downloads) to automatically scrobble the movies and episodes you watch from your media center.
But I found nothing to integrate with Netflix, so I created this extension.
Every time you click to play something on Netflix, it will send the scrobble to Trakt.tv. Cool, isn't it?
But there are none for Netflix.
This extension allows you to scrobble from Netflix to Trakt.tv. Cool, isn't it?

### How does traktflix work?
Unfortunately Netflix doesn't provide a public API, so the movie or episode info is extracted from the HTML of the player.
@@ -43,20 +46,20 @@ This extension only works with Netflix HTML player and new layout. If you are in
See this link for more info: https://help.netflix.com/en/node/23742

### Problems
If you find any problems or have suggestions or questions, feel free to [open an issue](https://github.com/tegon/traktflix/issues/new)
If you find any problems or have suggestions or questions, feel free to [open an issue](https://github.com/gsrafael01/traktflix/issues/new)

### Development
Create an application in [Trakt API](http://trakt.tv/oauth/applications/new).

Don't forget to check `/scrobble` permission.

In `Redirect uri:` put `https://{extensionId}.chromiumapp.org`
In `Redirect uri:` put `https://www.netflix.com/Activate`

In `Javascript (cors) origins:` put `https://{extensionId}.chromiumapp.org` and `chrome-extension://{extensionId}`
In `Javascript (cors) origins:` put `http://www.netflix.com, moz-extension:// and chrome-extension://`

Copy the `config.json` example file and change Trakt.tv credentials:
```bash
cp config.json.dev config.json
cp config.dev.json config.json
```

Use [nvm](https://github.com/creationix/nvm) to run in the correct version of node
@@ -75,7 +78,12 @@ To run in development mode
npm start
```

To get build version (generates app.zip, ready for chrome store)
To get build version for development mode (unlike npm start this does not watch the files for changes)
```bash
npm run build-dev
```

To get build version for production mode (generates app.zip, ready for deployment)
```bash
npm run build
npm run zip
@@ -86,6 +94,8 @@ To run tests
npm test
```

The commands above have only been tested on Linux.

### Credits
<h3 align="center">
<a href="https://tegon.github.io/traktflix/">
@@ -99,4 +109,7 @@ npm test
This product uses the TMDb API but is not endorsed or certified by TMDb. <br>
This product uses the Trakt.tv API.

[tegon](https://github.com/user/tegon) is the original developer of this extension.
Since it was not having many updates in the past year and was also removed from the Chrome store, I took it upon myself to work on it and finally port it to Firefox.

[LICENSE](LICENSE)
Oops, something went wrong.

0 comments on commit fbc8807

Please sign in to comment.