File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,6 +74,13 @@ class MainProcess {
7474 // 配置 COOP/COEP/CORP 头,FFmpeg 需要
7575 session . defaultSession . webRequest . onHeadersReceived ( ( details , callback ) => {
7676 const responseHeaders = { ...details . responseHeaders } ;
77+ const url = new URL ( details . url ) ;
78+
79+ // 桌面歌词窗口需要透明背景,必须排除严格的安全策略
80+ if ( url . searchParams . get ( "win" ) === "desktop-lyric" ) {
81+ callback ( { responseHeaders } ) ;
82+ return ;
83+ }
7784
7885 // 同样可以解决 CORS 限制,但为了避免安全问题,等真有需要的时候再开
7986 // responseHeaders["Access-Control-Allow-Origin"] = ["*"];
Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ class LyricWindow {
7777 } ) ;
7878 if ( ! this . win ) return null ;
7979 // 加载地址
80- this . win . loadURL ( lyricWinUrl ) ;
80+ const url = new URL ( lyricWinUrl ) ;
81+ url . searchParams . set ( "win" , "desktop-lyric" ) ;
82+ this . win . loadURL ( url . toString ( ) ) ;
8183 // 窗口事件
8284 this . event ( ) ;
8385 return this . win ;
You can’t perform that action at this time.
0 commit comments