diff --git a/src/plugins/api-server/backend/main.ts b/src/plugins/api-server/backend/main.ts index 40cd145e..e7072ea8 100644 --- a/src/plugins/api-server/backend/main.ts +++ b/src/plugins/api-server/backend/main.ts @@ -24,9 +24,10 @@ export const backend = createBackend({ this.songInfo = songInfo; }); - ctx.ipc.on('ytmd:player-api-loaded', () => - ctx.ipc.send('ytmd:setup-time-changed-listener'), - ); + ctx.ipc.on('ytmd:player-api-loaded', () => { + ctx.ipc.send('ytmd:setup-time-changed-listener'); + ctx.ipc.send('ytmd:setup-repeat-changed-listener'); + }); ctx.ipc.on( 'ytmd:repeat-changed', @@ -59,6 +60,12 @@ export const backend = createBackend({ this.app.use('*', cors()); + // for web remote control + this.app.use('*', async (ctx, next) => { + ctx.header('Access-Control-Request-Private-Network', 'true'); + await next(); + }); + // middlewares this.app.use('/api/*', async (ctx, next) => { if (config.authStrategy !== AuthStrategy.NONE) {