mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
Improve readme snippets
This commit is contained in:
15
readme.md
15
readme.md
@ -28,7 +28,7 @@ Here are the links to the current version:
|
|||||||
|
|
||||||
## Dev
|
## Dev
|
||||||
|
|
||||||
```
|
```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
|
npm install
|
||||||
@ -48,7 +48,7 @@ Create a folder in `plugins/YOUR-PLUGIN-NAME`:
|
|||||||
|
|
||||||
- if you need to manipulate the BrowserWindow, create a file `back.js` with the following template:
|
- if you need to manipulate the BrowserWindow, create a file `back.js` with the following template:
|
||||||
|
|
||||||
```
|
```node
|
||||||
module.exports = win => {
|
module.exports = win => {
|
||||||
// win is the BrowserWindow object
|
// win is the BrowserWindow object
|
||||||
};
|
};
|
||||||
@ -56,7 +56,7 @@ module.exports = win => {
|
|||||||
|
|
||||||
- if you need to change the front, create a file `front.js` with the following template:
|
- if you need to change the front, create a file `front.js` with the following template:
|
||||||
|
|
||||||
```
|
```node
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
// This function will be called as a preload script
|
// This function will be called as a preload script
|
||||||
// So you can use front features like `document.querySelector`
|
// So you can use front features like `document.querySelector`
|
||||||
@ -67,7 +67,10 @@ module.exports = () => {
|
|||||||
|
|
||||||
- injecting custom CSS: create a `style.css` file in the same folder then:
|
- injecting custom CSS: create a `style.css` file in the same folder then:
|
||||||
|
|
||||||
```
|
```node
|
||||||
|
const path = require("path");
|
||||||
|
const { injectCSS } = require("../utils");
|
||||||
|
|
||||||
// back.js
|
// back.js
|
||||||
module.exports = win => {
|
module.exports = win => {
|
||||||
injectCSS(win.webContents, path.join(__dirname, "style.css"));
|
injectCSS(win.webContents, path.join(__dirname, "style.css"));
|
||||||
@ -76,7 +79,7 @@ module.exports = win => {
|
|||||||
|
|
||||||
- changing the HTML:
|
- changing the HTML:
|
||||||
|
|
||||||
```
|
```node
|
||||||
// front.js
|
// front.js
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
// Remove the login button
|
// Remove the login button
|
||||||
@ -88,7 +91,7 @@ module.exports = () => {
|
|||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
```
|
```sh
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user