Compare commits

..

31 Commits

Author SHA1 Message Date
a3d5c038ea Merge pull request #13 from th-ch/snyk-upgrade-5770951f6ab79d4e413754bb7cab1225
[Snyk] Upgrade electron-localshortcut from 3.1.0 to 3.2.1
2020-03-15 12:38:57 +01:00
TC
91f7a0d1a5 Upgrade electron-localshortcut from 3.1.0 to 3.2.1 2020-03-15 12:22:41 +01:00
d5a6e50017 Merge pull request #12 from th-ch/snyk-upgrade-ab1b7600d9bb3bfaa5180a93741f304a
[Snyk] Upgrade electron-updater from 4.0.6 to 4.2.2
2020-03-15 12:21:17 +01:00
TC
6d8204f60a Bump appveyor to node 10 (semver requires node >=10) 2020-03-15 12:02:44 +01:00
TC
f25bb59065 Bump electron updater 2020-03-15 12:02:12 +01:00
39c7d56791 Merge pull request #15 from th-ch/snyk-upgrade-d9ce5c80db3f2ceedbda9bf03d7e2e8e
[Snyk] Upgrade electron-debug from 2.1.0 to 2.2.0
2020-03-15 11:56:01 +01:00
1a0369b69d Merge pull request #16 from th-ch/fix-vulnerability
Fix vulnerability
2020-03-15 11:55:19 +01:00
e5b4e01a96 fix: upgrade electron-debug from 2.1.0 to 2.2.0
Snyk has created this PR to upgrade electron-debug from 2.1.0 to 2.2.0.

See this package in NPM:
https://www.npmjs.com/package/electron-debug

See this project in Snyk:
https://app.snyk.io/org/th-ch/project/81809c53-bb7b-46b9-a0d7-806d45d74ac6?utm_source=github&utm_medium=upgrade-pr
2020-03-15 02:28:47 +00:00
TC
0a6587942b Add snyk badge to readme 2020-03-15 00:15:28 +01:00
TC
7050dfca5c Bump electron-store to fix a vulnerability 2020-03-15 00:03:58 +01:00
4a7a94240a Merge pull request #11 from th-ch/autoconfirm-when-paused
Plugin: autoconfirm when paused
2020-03-14 23:43:22 +01:00
TC
479013f9c9 Generate fake package.json for electron-builder to resolve modules 2020-03-14 23:11:11 +01:00
TC
164c3141ca Bump version to 1.2.0 2020-03-14 18:14:54 +01:00
TC
234954a86c Travis: fix MacOS build 2020-03-14 18:03:26 +01:00
TC
8c19757dfc Readme: build with npm 2020-03-14 16:46:43 +01:00
TC
790185893d Build/release with npm on travis 2020-03-14 16:31:07 +01:00
TC
7a816fa4f3 Use node 10 in linux container 2020-03-14 15:22:45 +01:00
TC
d4b5c53dc3 Add env var to allow unresolved deps 2020-03-14 14:51:19 +01:00
TC
e1b83f07a8 Block promo element 2020-03-14 09:32:48 +01:00
TC
b855726973 New plugin: autoconfirm when paused 2020-03-14 09:32:37 +01:00
TC
9371a4827e Migrate to yarn to install packages without package.json (but keep npm rebuild) 2020-03-14 09:32:14 +01:00
TC
81ce939451 Lint readme 2020-03-13 22:17:54 +01:00
TC
6fd10ea4a0 Bump version to 1.1.6 2019-09-11 23:49:31 +02:00
TC
746b5f13bb Fix Google login 2019-09-11 23:46:19 +02:00
474bfd19a2 Merge pull request #7 from th-ch/dependabot/npm_and_yarn/eslint-utils-1.4.2
Bump eslint-utils from 1.3.1 to 1.4.2
2019-09-03 13:41:20 +02:00
71222649a0 Bump eslint-utils from 1.3.1 to 1.4.2
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-26 22:51:08 +00:00
TC
1a72129108 npm audit fix 2019-07-13 19:51:01 +02:00
3108e16018 Merge pull request #4 from th-ch/dependabot/npm_and_yarn/lodash.mergewith-4.6.2
Bump lodash.mergewith from 4.6.1 to 4.6.2
2019-07-13 19:47:14 +02:00
fae19f4533 Merge pull request #5 from th-ch/dependabot/npm_and_yarn/lodash-4.17.14
Bump lodash from 4.17.11 to 4.17.14
2019-07-13 19:47:01 +02:00
348f1b8189 Bump lodash from 4.17.11 to 4.17.14
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.14.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.14)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-13 05:20:15 +00:00
ffdc7f66b9 Bump lodash.mergewith from 4.6.1 to 4.6.2
Bumps [lodash.mergewith](https://github.com/lodash/lodash) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-11 10:21:14 +00:00
11 changed files with 5402 additions and 7367 deletions

2
.npmrc Normal file
View File

@ -0,0 +1,2 @@
engine-strict=true
scripts-prepend-node-path=true

View File

@ -13,8 +13,8 @@ matrix:
language: generic language: generic
cache: cache:
yarn: false
directories: directories:
- node_modules
- $HOME/.cache/electron - $HOME/.cache/electron
- $HOME/.cache/electron-builder - $HOME/.cache/electron-builder
@ -30,13 +30,15 @@ script:
-v ${PWD}:/project \ -v ${PWD}:/project \
-v ~/.cache/electron:/root/.cache/electron \ -v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \ -v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder \ electronuserland/builder:10 \
/bin/bash -c "npm install && npm run release:linux" /bin/bash -c "yarn && npm run release:linux"
else else
npm run release:mac npm run release:mac
fi fi
before_cache: before_cache:
- rm -rf $HOME/.cache/electron-builder - rm -rf $HOME/.cache/electron-builder
before_install:
- rm -rf node_modules
branches: branches:
except: except:

View File

@ -11,10 +11,10 @@ init:
- git config --global core.autocrlf input - git config --global core.autocrlf input
install: install:
- ps: Install-Product node 8 x64 - ps: Install-Product node 10 x64
- npm install - yarn
build_script: build_script:
- npm run release:win - yarn run release:win
test: off test: off

View File

@ -42,8 +42,10 @@ function createMainWindow() {
backgroundColor: "#000", backgroundColor: "#000",
show : false, show : false,
webPreferences : { webPreferences : {
nodeIntegration: false, nodeIntegration : false,
preload : path.join(__dirname, "preload.js") preload : path.join(__dirname, "preload.js"),
nativeWindowOpen: true, // window.open return Window object(like in regular browsers), not BrowserWindowProxy
affinity : "main-window" // main window, and addition windows should work in one process
}, },
frame : !is.macOS(), frame : !is.macOS(),
titleBarStyle: is.macOS() ? "hiddenInset": "default" titleBarStyle: is.macOS() ? "hiddenInset": "default"
@ -86,6 +88,17 @@ function createMainWindow() {
} }
}); });
win.webContents.on(
"new-window",
(e, url, frameName, disposition, options) => {
// hook on new opened window
// at now new window in mainWindow renderer process.
// Also, this will automatically get an option `nodeIntegration=false`(not override to true, like in iframe's) - like in regular browsers
options.webPreferences.affinity = "main-window";
}
);
win.on("move", () => { win.on("move", () => {
let position = win.getPosition(); let position = win.getPosition();
store.set("window-position", { x: position[0], y: position[1] }); store.set("window-position", { x: position[0], y: position[1] });

7321
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,60 +1,65 @@
{ {
"name" : "youtube-music", "name": "youtube-music",
"productName": "YouTube Music", "productName": "YouTube Music",
"version" : "1.1.5", "version": "1.2.0",
"description": "YouTube Music Desktop App - including custom plugins", "description": "YouTube Music Desktop App - including custom plugins",
"license" : "MIT", "license": "MIT",
"repository" : "th-ch/youtube-music", "repository": "th-ch/youtube-music",
"author" : { "author": {
"name" : "th-ch", "name": "th-ch",
"email": "th-ch@users.noreply.github.com", "email": "th-ch@users.noreply.github.com",
"url" : "https://github.com/th-ch/youtube-music" "url": "https://github.com/th-ch/youtube-music"
}, },
"build": { "build": {
"appId" : "com.github.th-ch.youtube-music", "appId": "com.github.th-ch.youtube-music",
"productName": "YouTube Music", "productName": "YouTube Music",
"mac" : { "mac": {
"identity": null, "identity": null,
"icon" : "assets/generated/icons/mac/icon.icns" "icon": "assets/generated/icons/mac/icon.icns"
}, },
"win": { "win": {
"icon": "assets/generated/icons/win/icon.ico" "icon": "assets/generated/icons/win/icon.ico"
}, },
"linux": { "linux": {
"icon" : "assets/generated/icons/png", "icon": "assets/generated/icons/png",
"category": "AudioVideo" "category": "AudioVideo"
} }
}, },
"scripts": { "scripts": {
"test" : "xo", "test": "xo",
"start" : "electron .", "start": "electron .",
"icon" : "rimraf assets/generated && electron-icon-maker --input=assets/youtube-music.png --output=assets/generated", "icon": "rimraf assets/generated && electron-icon-maker --input=assets/youtube-music.png --output=assets/generated",
"postinstall" : "npm run icon && npm rebuild && node plugins/adblocker/generator.js && electron-rebuild", "generate:package": "node utils/generate-package-json.js",
"clean" : "rimraf dist", "postinstall": "yarn run generate:package YoutubeNonStop && yarn run icon && npm rebuild && node plugins/adblocker/generator.js && electron-rebuild",
"build" : "npm run clean && build --win --mac --linux", "clean": "rimraf dist",
"build:mac" : "npm run clean && build --mac", "build": "yarn run clean && build --win --mac --linux",
"build:win" : "npm run clean && build --win", "build:mac": "yarn run clean && build --mac",
"release:linux": "npm run clean && build --linux -p always", "build:win": "yarn run clean && build --win",
"release:mac" : "npm run clean && build --mac -p always", "release:linux": "yarn run clean && build --linux -p always",
"release:win" : "npm run clean && build --win -p always" "release:mac": "yarn run clean && build --mac -p always",
"release:win": "yarn run clean && build --win -p always"
},
"engines": {
"npm": "Please use yarn and not npm"
}, },
"dependencies": { "dependencies": {
"ad-block" : "^4.1.3", "YoutubeNonStop": "git://github.com/lawfx/YoutubeNonStop.git#v0.7.1",
"electron-debug" : "^2.0.0", "ad-block": "^4.1.3",
"electron-is" : "^3.0.0", "electron-debug": "^2.2.0",
"electron-localshortcut": "^3.1.0", "electron-is": "^3.0.0",
"electron-store" : "^2.0.0", "electron-localshortcut": "^3.2.1",
"electron-updater" : "^4.0.6" "electron-store": "^3.1.0",
"electron-updater": "^4.2.2"
}, },
"devDependencies": { "devDependencies": {
"devtron" : "^1.4.0", "devtron": "^1.4.0",
"electron" : "^4.0.8", "electron": "^4.0.8",
"electron-builder" : "^20.40.2", "electron-builder": "^20.40.2",
"electron-devtools-installer": "^2.2.4", "electron-devtools-installer": "^2.2.4",
"electron-icon-maker" : "0.0.4", "electron-icon-maker": "0.0.4",
"electron-rebuild" : "^1.8.4", "electron-rebuild": "^1.8.4",
"rimraf" : "^2.6.3", "rimraf": "^2.6.3",
"xo" : "^0.24.0" "xo": "^0.24.0"
}, },
"xo": { "xo": {
"envs": [ "envs": [

View File

@ -0,0 +1,12 @@
// Define global chrome object to be compliant with the extension code
global.chrome = {
runtime: {
getManifest: () => ({
version: 1
})
}
};
module.exports = () => {
require("YoutubeNonStop/autoconfirm.js");
};

View File

@ -1,9 +1,11 @@
# YouTube Music # YouTube Music
[![GitHub release](https://img.shields.io/github/release/th-ch/youtube-music.svg)](https://GitHub.com/th-ch/youtube-music/releases/) [![GitHub release](https://img.shields.io/github/release/th-ch/youtube-music.svg)](https://GitHub.com/th-ch/youtube-music/releases/)
[![GitHub license](https://img.shields.io/github/license/th-ch/youtube-music.svg)](https://github.com/th-ch/youtube-music/blob/master/LICENSE) [![GitHub license](https://img.shields.io/github/license/th-ch/youtube-music.svg)](https://github.com/th-ch/youtube-music/blob/master/LICENSE)
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![Build status](https://ci.appveyor.com/api/projects/status/tgre12r150ynvwl2?svg=true)](https://ci.appveyor.com/project/th-ch/youtube-music) [![Build status](https://ci.appveyor.com/api/projects/status/tgre12r150ynvwl2?svg=true)](https://ci.appveyor.com/project/th-ch/youtube-music)
[![Build Status](https://travis-ci.org/th-ch/youtube-music.svg?branch=master)](https://travis-ci.org/th-ch/youtube-music) [![Build Status](https://travis-ci.org/th-ch/youtube-music.svg?branch=master)](https://travis-ci.org/th-ch/youtube-music)
[![Known Vulnerabilities](https://snyk.io/test/github/th-ch/youtube-music/badge.svg)](https://snyk.io/test/github/th-ch/youtube-music)
![Screenshot](screenshot.jpg "Screenshot") ![Screenshot](screenshot.jpg "Screenshot")
@ -22,14 +24,15 @@ You can check out the [latest release](https://github.com/th-ch/youtube-music/re
- **No Google Login**: remove Google login buttons and links from the interface - **No Google Login**: remove Google login buttons and links from the interface
- **Shortcuts**: use your usual shortcuts (media keys, Ctrl/CMD + F…) to control YouTube Music - **Shortcuts**: use your usual shortcuts (media keys, Ctrl/CMD + F…) to control YouTube Music
- **Navigation**: next/back navigation arrows directly integrated in the interface, like in your favorite browser - **Navigation**: next/back navigation arrows directly integrated in the interface, like in your favorite browser
- **Auto confirm when paused**: when the "Continue Watching?" modal appears, automatically click "Yes"
## Dev ## Dev
```sh ```sh
git clone https://github.com/th-ch/youtube-music git clone https://github.com/th-ch/youtube-music
cd youtube-music cd youtube-music
npm install yarn
npm start yarn start
``` ```
## Build your own plugins ## Build your own plugins
@ -80,7 +83,7 @@ module.exports = win => {
// front.js // front.js
module.exports = () => { module.exports = () => {
// Remove the login button // Remove the login button
document.querySelector('.sign-in-link.ytmusic-nav-bar').remove(); document.querySelector(".sign-in-link.ytmusic-nav-bar").remove();
}; };
``` ```

34
utils/generate-package-json.js Executable file
View File

@ -0,0 +1,34 @@
#!/usr/bin/env node
const { existsSync, writeFile } = require("fs");
const { join } = require("path");
const { promisify } = require("util");
/**
* Generates a fake package.json for given packages that don't have any.
* Allows electron-builder to resolve them
*/
const generatePackageJson = async packageName => {
var filepath = join("node_modules", packageName, "package.json");
if (!existsSync(filepath)) {
console.log(
`No package.json found for ${packageName} module, generating one…`
);
pkg = {
name: packageName,
version: "0.0.0",
description: "-",
repository: { type: "git", url: "-" },
readme: "-"
};
const writeFileAsync = promisify(writeFile);
await writeFileAsync(filepath, JSON.stringify(pkg, null, 2));
}
};
if (require.main === module) {
process.argv.slice(2).forEach(async packageName => {
await generatePackageJson(packageName);
});
}

5280
yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -23,3 +23,8 @@ ytmusic-app-layout {
ytmusic-search-box.ytmusic-nav-bar { ytmusic-search-box.ytmusic-nav-bar {
margin-top: 12px; margin-top: 12px;
} }
/* Blocking annoying elements */
ytmusic-mealbar-promo-renderer {
display: none !important;
}