Skip to content
Permalink
Browse files

- Use the promise-based browser API instead of the callback-based chr…

…ome API

- Rename ChromeStorage.js to BrowserStorage.js accordingly
- Use webextension-polyfill for browsers that don't support the browser API
- Use browser.storage.sync to sync the user's preferences across all of their devices
- Use browser.permissions to grant optional permissions that are not required for the basic functioning of the extension
- Add functionality of sending / receiving correction suggestions from the Google Sheets database as an option
- Add option to load more than 1 page at once in the history sync
- Fall back to authentication through a new tab if authentication through browser.identity failed
- Update tests
- Other minor changes
  • Loading branch information...
gsrafael01 committed Feb 2, 2019
1 parent fbc8807 commit 27d298d13715e90c509a0e48e8ed575944b5e1b2
Showing with 4,895 additions and 794 deletions.
  1. BIN ChromeWebStore_BadgeWBorder_v2_206x58.png
  2. +11 −11 README.md
  3. +15 −0 app/_locales/en/messages.json
  4. +15 −0 app/_locales/pt_BR/messages.json
  5. +1 −0 app/history-sync.html
  6. +1 −1 app/js/background.js
  7. +9 −0 app/js/browser-polyfill.js
  8. +1 −1 app/js/content.js
  9. +3,511 −10 app/js/history-sync.js
  10. +11 −10 app/js/options.js
  11. +11 −10 app/js/popup.js
  12. +1 −1 app/js/vendor.js
  13. +14 −11 app/manifest.json
  14. +1 −0 app/options.html
  15. +1 −0 app/popup.html
  16. BIN chrome-badge.png
  17. BIN firefox-badge.png
  18. +2 −2 karma.conf.js
  19. +16 −12 package.json
  20. +1 −0 src/assets/index.js
  21. +24 −1 src/assets/styles/history-sync.css
  22. +99 −0 src/class/BrowserStorage.js
  23. +0 −66 src/class/ChromeStorage.js
  24. +1 −1 src/class/ErrorBoundary.js
  25. +95 −76 src/class/NetflixApiUtils.js
  26. +36 −19 src/class/Oauth.js
  27. +20 −0 src/class/Permissions.js
  28. +27 −4 src/class/Request.js
  29. +5 −4 src/class/Rollbar.js
  30. +1 −1 src/class/Search.js
  31. +53 −0 src/class/Select.js
  32. +23 −16 src/class/content/ContentController.js
  33. +19 −13 src/class/content/EventWatcher.js
  34. +10 −10 src/class/content/Scrobble.js
  35. +20 −12 src/class/history-sync/ActivityActionCreators.js
  36. +2 −2 src/class/history-sync/ActivityList.js
  37. +26 −21 src/class/history-sync/ActivityListItem.js
  38. +10 −5 src/class/history-sync/ActivityStore.js
  39. +3 −3 src/class/history-sync/TraktURLForm.js
  40. +4 −4 src/class/history-sync/TraktWebAPIUtils.js
  41. +47 −11 src/class/history-sync/ViewingActivityApp.js
  42. +1 −1 src/class/options/OptionsActionCreators.js
  43. +2 −2 src/class/options/OptionsList.js
  44. +2 −1 src/class/options/OptionsListItem.js
  45. +8 −8 src/class/options/OptionsStore.js
  46. +25 −9 src/class/options/OptionsUtils.js
  47. +26 −13 src/class/options/ViewingOptionsApp.js
  48. +2 −2 src/class/popup/About.js
  49. +21 −22 src/class/popup/App.js
  50. +2 −2 src/class/popup/Button.js
  51. +8 −8 src/class/popup/Header.js
  52. +2 −2 src/class/popup/Info.js
  53. +1 −1 src/class/popup/Loading.js
  54. +6 −5 src/class/popup/LoginButton.js
  55. +3 −3 src/class/popup/Watching.js
  56. +2 −2 src/class/tmdb/TmdbImage.js
  57. +2 −2 src/class/tmdb/TmdbImageContainer.js
  58. +90 −79 src/modules/background/index.js
  59. +10 −8 src/modules/content/index.js
  60. +1 −0 src/modules/history-sync/activity-constants.js
  61. +8 −5 src/modules/history-sync/index.js
  62. +3 −3 src/modules/options/index.js
  63. +2 −2 src/modules/popup/index.js
  64. +2 −2 src/modules/popup/messages.js
  65. +161 −0 test/BrowserStorage.js
  66. +0 −99 test/ChromeStorage.js
  67. +1 −1 test/ErrorBoundary.js
  68. +106 −53 test/Oauth.js
  69. +11 −6 test/Search.js
  70. +74 −25 test/content/ContentController.js
  71. +55 −1 test/content/EventWatcher.js
  72. +42 −37 test/content/Scrobble.js
  73. +10 −10 test/popup/Button.js
  74. +12 −6 test/popup/Header.js
  75. +10 −8 test/popup/Info.js
  76. +1 −1 test/popup/Loading.js
  77. +16 −13 test/popup/LoginButton.js
  78. +10 −8 test/popup/Watching.js
  79. +10 −6 webpack.config.js
Binary file not shown.
@@ -1,7 +1,7 @@
<h1 align="center">
<br>
<a href="https://tegon.github.io/traktflix/">
<img src="https://raw.githubusercontent.com/tegon/traktflix/master/app/images/traktflix-icon-128.png" alt="Traktflix" width="150">
<img src="https://github.com/tegon/traktflix/raw/master/app/img/traktflix-icon-128.png" alt="Traktflix" width="150">
</a>
<br>
traktflix
@@ -13,13 +13,16 @@
<h4 align="center">A Trakt.tv scrobbler for Netflix.</h4>

<p align="center">
<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>
<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.com/tegon/traktflix"><img src="https://travis-ci.com/tegon/traktflix.svg?branch=master" alt="travis"></a>
<a href='https://coveralls.io/github/tegon/traktflix?branch=master'><img src='https://coveralls.io/repos/github/tegon/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>
<a href="https://chrome.google.com/webstore/detail/traktflix/ehlckfimahifadnbecobagimllmbdmde"><img src="https://github.com/tegon/traktflix/raw/master/chrome-badge.png" alt="Get the extension on Chrome"></a>
</p>
<p align=left">
<a href="https://addons.mozilla.org/en-US/firefox/addon/traktflix"><img src="https://github.com/tegon/traktflix/raw/master/firefox-badge.png" alt="Get the extension on Firefox"></a>
</p>

### Table of Contents
@@ -46,7 +49,7 @@ 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/gsrafael01/traktflix/issues/new)
If you find any problems or have suggestions or questions, feel free to [open an issue](https://github.com/tegon/traktflix/issues/new)

### Development
Create an application in [Trakt API](http://trakt.tv/oauth/applications/new).
@@ -99,17 +102,14 @@ The commands above have only been tested on Linux.
### Credits
<h3 align="center">
<a href="https://tegon.github.io/traktflix/">
<img src="https://raw.githubusercontent.com/tegon/traktflix/master/tmdb-api-logo.png" alt="TMDB" width="150">
<img src="https://github.com/tegon/traktflix/raw/master/tmdb-api-logo.png" alt="TMDB" width="150">
</a>
<a href="https://tegon.github.io/traktflix/">
<img src="https://raw.githubusercontent.com/tegon/traktflix/master/trakt-api-logo.png" alt="TMDB" width="150">
<img src="https://github.com/tegon/traktflix/raw/master/trakt-api-logo.png" alt="TMDB" width="150">
</a>
</h3>

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)
@@ -68,6 +68,15 @@
"nextPage": {
"message": "Next page"
},
"pagesToLoad": {
"message": "Pages to load"
},
"allPages": {
"message": "All"
},
"loadingPage": {
"message": "Loading page"
},
"noMoreHistory": {
"message": "There's no more items in your history. Refresh the page to go to the beginning."
},
@@ -95,6 +104,12 @@
"showNotificationsDescription": {
"message": "With this option enabled, you will receive browser notifications whenever you start/stop scrobbling something."
},
"sendReceiveSuggestionsName": {
"message": "Send / receive correction suggestions."
},
"sendReceiveSuggestionsDescription": {
"message": "With this option enabled, whenever you update a wrong item in the history sync, the correction will be sent to a Google Sheets database so that other users can receive correction suggestions. This option is also required to receive those correction suggestions."
},
"saveOptionsSuccess": {
"message": "Options saved."
},
@@ -68,6 +68,15 @@
"nextPage": {
"message": "Próxima página"
},
"pagesToLoad": {
"message": "Páginas para carregar"
},
"allPages": {
"message": "Todas"
},
"loadingPage": {
"message": "Carregando página"
},
"noMoreHistory": {
"message": "Não existem mais itens no seu histórico. Atualize a página para voltar ao início."
},
@@ -95,6 +104,12 @@
"showNotificationsDescription": {
"message": "Com essa opção ativada, você receberá notificações no seu navegador sempre que um scrobble começar/parar ."
},
"sendReceiveSuggestionsName": {
"message": "Enviar / receber sugestões de correção."
},
"sendReceiveSuggestionsDescription": {
"message": "Com essa opção ativada, sempre que você atualizar um item errado no histórico, a correção será enviada para uma base de dados armazenada no Google Sheets para que outros usuários possam receber sugestões de correção. Essa opção também é necessária para receber essas sugestões de correção."
},
"saveOptionsSuccess": {
"message": "Opções salvas."
},
@@ -15,6 +15,7 @@
<div class="page-content" id="viewing-activity-app"></div>
</main>
</div>
<script type="text/javascript" src="js/browser-polyfill.js"></script>
<script type="text/javascript" src="js/vendor.js"></script>
<script type="text/javascript" src="js/history-sync.js"></script>
</body>

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,13 +1,15 @@
{
"background": {
"scripts": [
"js/browser-polyfill.js",
"js/vendor.js",
"js/background.js"
]
},
"content_scripts": [
{
"js": [
"js/browser-polyfill.js",
"js/content.js"
],
"matches": [
@@ -32,22 +34,23 @@
"default_popup": "popup.html",
"default_title": "traktflix"
},
"permissions": [
"*://*.netflix.com/*",
"optional_permissions": [
"notifications",
"*://api.rollbar.com/*",
"*://api.trakt.tv/*",
"*://trakt.tv/*",
"https://www.google-analytics.com/",
"https://script.google.com/",
"https://script.googleusercontent.com/",
"cookies",
"*://google-analytics.com/*",
"*://script.google.com/*",
"*://script.googleusercontent.com/*"
],
"permissions": [
"declarativeContent",
"identity",
"notifications",
"storage",
"tabs",
"unlimitedStorage"
"unlimitedStorage",
"*://*.netflix.com/*",
"*://*.trakt.tv/*"
],
"version": "2.0.4",
"version": "2.0.7",
"web_accessible_resources": [
"img/traktflix-icon-38.png",
"img/traktflix-icon-selected-38.png",
@@ -15,6 +15,7 @@
<div class="page-content" id="viewing-options-app"></div>
</main>
</div>
<script type="text/javascript" src="js/browser-polyfill.js"></script>
<script type="text/javascript" src="js/vendor.js"></script>
<script type="text/javascript" src="js/options.js"></script>
</body>
@@ -6,6 +6,7 @@
</head>
<body>
<div class="app-container"></div>
<script type="text/javascript" src="js/browser-polyfill.js"></script>
<script type="text/javascript" src="js/vendor.js"></script>
<script type="text/javascript" src="js/popup.js"></script>
</body>
BIN +3.67 KB chrome-badge.png
Binary file not shown.
BIN +5.92 KB firefox-badge.png
Binary file not shown.
@@ -1,10 +1,10 @@
module.exports = config => {
let webpackConfig = require(`./webpack.config.js`);
webpackConfig = webpackConfig({development: true});
webpackConfig = webpackConfig({ development: true, test: true });
const configuration = {
autoWatch: false,
basePath: '',
browsers: [`Firefox`],
browsers: [`Chrome`, `Firefox`],
client: {
jasmine: {
random: false
Oops, something went wrong.

0 comments on commit 27d298d

Please sign in to comment.
You can’t perform that action at this time.