Skip to content
Permalink
Browse files

Initial commit - an extension is born!

  • Loading branch information...
Andrew Brey
Andrew Brey committed Jul 9, 2018
0 parents commit dbefefe55c489c24f69a22da3477465b574f49b6
Showing with 18,220 additions and 0 deletions.
  1. +3 −0 .babelrc
  2. +28 −0 .editorconfig
  3. +7 −0 .eslintignore
  4. +16 −0 .eslintrc
  5. +1 −0 .gitattributes
  6. +12 −0 .gitignore
  7. +11 −0 CHANGELOG.md
  8. +21 −0 LICENSE
  9. +32 −0 README.md
  10. +10 −0 app/_locales/en/messages.json
  11. BIN app/images/icon-128.png
  12. BIN app/images/icon-150.png
  13. BIN app/images/icon-16.png
  14. BIN app/images/icon-19.png
  15. BIN app/images/icon-24.png
  16. BIN app/images/icon-32.png
  17. BIN app/images/icon-38.png
  18. BIN app/images/web-store-pill.png
  19. +45 −0 app/manifest.json
  20. +19 −0 app/scripts.babel/background.js
  21. +29 −0 app/scripts.babel/live-reload.js
  22. +58 −0 app/scripts.babel/netflix-tweak.js
  23. +6 −0 app/scripts.vendor/materialize.min.js
  24. +1 −0 app/scripts.vendor/ramda.min.js
  25. +1 −0 app/scripts.vendor/simple-scrollbar.min.js
  26. +45 −0 app/styles.scss/main.scss
  27. +55 −0 app/styles.scss/materialize-components/_badges.scss
  28. +321 −0 app/styles.scss/materialize-components/_buttons.scss
  29. +195 −0 app/styles.scss/materialize-components/_cards.scss
  30. +90 −0 app/styles.scss/materialize-components/_carousel.scss
  31. +90 −0 app/styles.scss/materialize-components/_chips.scss
  32. +84 −0 app/styles.scss/materialize-components/_collapsible.scss
  33. +32 −0 app/styles.scss/materialize-components/_color-classes.scss
  34. +370 −0 app/styles.scss/materialize-components/_color-variables.scss
  35. +187 −0 app/styles.scss/materialize-components/_datepicker.scss
  36. +76 −0 app/styles.scss/materialize-components/_dropdown.scss
  37. +769 −0 app/styles.scss/materialize-components/_global.scss
  38. +156 −0 app/styles.scss/materialize-components/_grid.scss
  39. +5 −0 app/styles.scss/materialize-components/_icons-material-design.scss
  40. +43 −0 app/styles.scss/materialize-components/_materialbox.scss
  41. +90 −0 app/styles.scss/materialize-components/_modal.scss
  42. +208 −0 app/styles.scss/materialize-components/_navbar.scss
  43. +447 −0 app/styles.scss/materialize-components/_normalize.scss
  44. +334 −0 app/styles.scss/materialize-components/_preloader.scss
  45. +34 −0 app/styles.scss/materialize-components/_pulse.scss
  46. +216 −0 app/styles.scss/materialize-components/_sidenav.scss
  47. +92 −0 app/styles.scss/materialize-components/_slider.scss
  48. +33 −0 app/styles.scss/materialize-components/_table_of_contents.scss
  49. +99 −0 app/styles.scss/materialize-components/_tabs.scss
  50. +103 −0 app/styles.scss/materialize-components/_tapTarget.scss
  51. +183 −0 app/styles.scss/materialize-components/_timepicker.scss
  52. +59 −0 app/styles.scss/materialize-components/_toast.scss
  53. +32 −0 app/styles.scss/materialize-components/_tooltip.scss
  54. +13 −0 app/styles.scss/materialize-components/_transitions.scss
  55. +60 −0 app/styles.scss/materialize-components/_typography.scss
  56. +354 −0 app/styles.scss/materialize-components/_variables.scss
  57. +114 −0 app/styles.scss/materialize-components/_waves.scss
  58. +200 −0 app/styles.scss/materialize-components/forms/_checkboxes.scss
  59. +44 −0 app/styles.scss/materialize-components/forms/_file-input.scss
  60. +22 −0 app/styles.scss/materialize-components/forms/_forms.scss
  61. +352 −0 app/styles.scss/materialize-components/forms/_input-fields.scss
  62. +115 −0 app/styles.scss/materialize-components/forms/_radio-buttons.scss
  63. +161 −0 app/styles.scss/materialize-components/forms/_range.scss
  64. +178 −0 app/styles.scss/materialize-components/forms/_select.scss
  65. +89 −0 app/styles.scss/materialize-components/forms/_switches.scss
  66. 0 app/styles.scss/nt-components/_nt.scss
  67. +51 −0 app/styles.scss/nt-components/_simple-scrollbar.scss
  68. BIN design/assets.gvdesign
  69. +149 −0 gulpfile.babel.js
  70. +11,519 −0 package-lock.json
  71. +51 −0 package.json
@@ -0,0 +1,3 @@
{
"presets": ["env"]
}
@@ -0,0 +1,28 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

[*.html]
indent_style = tab
indent_size = 4

[*.json]
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
@@ -0,0 +1,7 @@
.idea
node_modules
temp
.tmp
dist
package
app/scripts
@@ -0,0 +1,16 @@
{
"env": {
"node": true,
"browser": true,
"es6": true
},
"globals": {
"chrome": true
},
"extends": "eslint:recommended",
"rules": {
"no-var": ["error"],
"semi": ["error", "always"],
"no-console": "off"
}
}
@@ -0,0 +1 @@
* text=auto
@@ -0,0 +1,12 @@
.idea/
*.iml
node_modules/
temp/
.tmp/
dist/
.sass-cache/
package/
app/scripts/
app/styles/
*.crx
*.pem
@@ -0,0 +1,11 @@
# Netflix Tweaked <img src="https://github.com/andrewbrey/netflix-tweaked/blob/master/app/images/icon-150.png" width="75" align="left" />

[![GitHub release](https://img.shields.io/github/package-json/v/andrewbrey/netflix-tweaked.svg)](https://github.com/andrewbrey/netflix-tweaked/releases)
[![License: MIT](https://img.shields.io/github/license/andrewbrey/netflix-tweaked.svg)](https://github.com/andrewbrey/netflix-tweaked/blob/master/LICENSE)

---
## Release Notes
### 1.x.x

- ***1.0.x***
- ***1.0.0*** - An extension is born :)
21 LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Andrew Brey

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,32 @@
# Netflix Tweaked <img src="https://github.com/andrewbrey/netflix-tweaked/blob/master/app/images/icon-150.png" width="75" align="left" />

[![GitHub release](https://img.shields.io/github/package-json/v/andrewbrey/netflix-tweaked.svg)](https://github.com/andrewbrey/netflix-tweaked/releases)
[![License: MIT](https://img.shields.io/github/license/andrewbrey/netflix-tweaked.svg)](https://github.com/andrewbrey/netflix-tweaked/blob/master/LICENSE)
<!---
[![Web store version](https://img.shields.io/chrome-web-store/v/TBD.svg)](https://chrome.google.com/webstore/detail/netflix-tweaked/TBD)
[![User count](https://img.shields.io/chrome-web-store/users/TBD.svg)](https://chrome.google.com/webstore/detail/netflix-tweaked/TBD)
--->

---

With the Netflix Tweaked extension, you never have to see or hear the hero trailer auto-playing on the Netflix browse screen ever again. Since I like you so much, I've also made it auto-sort your "continue watching" and "my list" feeds to the top! Enjoy a slightly less dumb Netflix user interface :)

This extension is open source and licensed under the MIT license, so you can feel free to check out the source code at the extension home page or even contribute to make it better!

<a href="https://chrome.google.com/webstore/detail/netflix-tweaked/TBD" target="_blank">
<img src="https://github.com/andrewbrey/netflix-tweaked/blob/master/app/images/web-store-pill.png" width="200" />
</a>
## Release History
See the [Release History](https://github.com/andrewbrey/netflix-tweaked/releases) for a list of all releases.
## Release Notes
See the [Release Notes](CHANGELOG.md) for details about changes in each release.
## License
This project is licensed under the MIT License - see the [license file](LICENSE) for details.
## Contact
If you have questions, problems or ideas, feel free to contact me at <a href="mailto:contact@fluencyy.com">contact@fluencyy.com</a>.
@@ -0,0 +1,10 @@
{
"appName": {
"message": "Netflix Tweaked",
"description": "The name of the application"
},
"appDescription": {
"message": "A Chrome extension to tweak the Netflix home screen, preventing auto-play trailers and moving your lists to the top",
"description": "The description of the application"
}
}
Binary file not shown.
Binary file not shown.
BIN +895 Bytes app/images/icon-16.png
Binary file not shown.
BIN +1.06 KB app/images/icon-19.png
Binary file not shown.
BIN +1.33 KB app/images/icon-24.png
Binary file not shown.
BIN +1.89 KB app/images/icon-32.png
Binary file not shown.
BIN +2.37 KB app/images/icon-38.png
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,45 @@
{
"name": "__MSG_appName__",
"version": "1.0.0",
"manifest_version": 2,
"description": "__MSG_appDescription__",
"homepage_url": "https://github.com/andrewbrey/netflix-tweaked",
"icons": {
"16": "images/icon-16.png",
"19": "images/icon-19.png",
"38": "images/icon-38.png",
"128": "images/icon-128.png",
"150": "images/icon-150.png"
},
"default_locale": "en",
"background": {
"scripts": [
"scripts/live-reload.js",
"scripts/background.js"
]
},
"content_scripts": [
{
"matches": [
"*://*.netflix.com/",
"*://*.netflix.com/browse/"
],
"js": [
"scripts/netflix-tweak.js"
],
"run_at": "document_idle"
}
],
"permissions": [
"declarativeContent"
],
"page_action": {
"default_icon": {
"16": "images/icon-16.png",
"24": "images/icon-24.png",
"32": "images/icon-32.png",
"128": "images/icon-128.png"
},
"default_title": "Netflix Tweaked"
}
}
@@ -0,0 +1,19 @@
(function (chrome) {
'use strict';

chrome.runtime.onInstalled.addListener(() => {
chrome.declarativeContent.onPageChanged.removeRules(undefined, function () {
chrome.declarativeContent.onPageChanged.addRules([
{
conditions: [
new chrome.declarativeContent.PageStateMatcher({
pageUrl: {hostSuffix: 'netflix.com', pathEquals: '/browse'},
})
],
actions: [new chrome.declarativeContent.ShowPageAction()]
}
]);
});
});

})(chrome);
@@ -0,0 +1,29 @@
'use strict';

// Reload client for Chrome Apps & Extensions.
// The reload client has a compatibility with livereload.
// WARNING: only supports reload command.

const LIVERELOAD_HOST = 'localhost';
const LIVERELOAD_PORT = 35729;
const CONNECTION = new WebSocket(`ws://${LIVERELOAD_HOST}:${LIVERELOAD_PORT}/livereload`);
const RELOAD_COOLDOWN = 5000;

let lastReload = Date.now();

CONNECTION.onerror = error => {
console.log('Reload connection got error:', error); // eslint-disable-line no-console
};

CONNECTION.onmessage = event => {
if (event.data) {
const data = JSON.parse(event.data);
if (data && data.command === 'reload') {
if (Date.now() - lastReload > RELOAD_COOLDOWN) {
chrome.runtime.reload();
chrome.developerPrivate.reload(chrome.runtime.id, {failQuietly: true});
}
}
}
};

@@ -0,0 +1,58 @@
(function () {
'use strict';

preventTrailerAutoPlay();
moveMyListsToTop();

function preventTrailerAutoPlay() {
console.log('called traler');
let counter = 0;
let interval = setInterval(function () {
counter++;

let video = document.querySelector('video');
if (video) {
clearInterval(interval);

// Should the video just be deleted? Not doing so allows the method calls not to fail (they just don't do anything)...
video.muted = true;
video.pause();
video.play = function () {
};

let image = document.querySelector('.hero.static-image');
if (image) {
image.style.opacity = '1';
}
} else if (counter > 30) {
clearInterval(interval);
}
}, 100);
}

function moveMyListsToTop(){
console.log('called lists');
[].forEach.call(document.querySelectorAll('.lolomo > :not(.billboard-row)'), row => {row.style.opacity = 0;});

let counter = 0;
let interval = setInterval(function(){
counter++;

let billboard = document.querySelector('.billboard-row');
let queue = document.querySelector('[data-list-context=queue]');
let continueWatching = document.querySelector('[data-list-context=continueWatching]');

if(billboard && queue && continueWatching) {
clearInterval(interval);

billboard.insertAdjacentElement('afterend', queue);
billboard.insertAdjacentElement('afterend', continueWatching);

[].forEach.call(document.querySelectorAll('.lolomo > :not(.billboard-row)'), row => {row.style.opacity = 1;});
} else if(counter > 20) {
clearInterval(interval);
}
}, 100);
}

})();

Large diffs are not rendered by default.

Large diffs are not rendered by default.

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

@@ -0,0 +1,45 @@
@charset "UTF-8";

// Color
@import "materialize-components/color-variables";
@import "materialize-components/color-classes";

// Variables;
@import "materialize-components/variables";

// Reset
@import "materialize-components/normalize";

// components
@import "materialize-components/global";
@import "materialize-components/badges";
@import "materialize-components/icons-material-design";
@import "materialize-components/grid";
@import "materialize-components/navbar";
@import "materialize-components/typography";
@import "materialize-components/transitions";
@import "materialize-components/cards";
@import "materialize-components/toast";
@import "materialize-components/tabs";
@import "materialize-components/tooltip";
@import "materialize-components/buttons";
@import "materialize-components/dropdown";
@import "materialize-components/waves";
@import "materialize-components/modal";
@import "materialize-components/collapsible";
@import "materialize-components/chips";
@import "materialize-components/materialbox";
@import "materialize-components/forms/forms";
@import "materialize-components/table_of_contents";
@import "materialize-components/sidenav";
@import "materialize-components/preloader";
@import "materialize-components/slider";
@import "materialize-components/carousel";
@import "materialize-components/tapTarget";
@import "materialize-components/pulse";
@import "materialize-components/datepicker";
@import "materialize-components/timepicker";

// Overrides
@import "nt-components/simple-scrollbar";
@import "nt-components/nt";

0 comments on commit dbefefe

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