auto open when detect m3u8

This commit is contained in:
Kyush 2026-06-06 21:37:06 +09:00
commit c0c69aa0c3

View file

@ -250,6 +250,20 @@ function onStreamDetected(url: string, headers?: Record<string, string>): void {
notifyTopFrame(url, headers);
if (isTopFrame() && !panel && type === 'm3u8') {
panel = createPanel();
const cancelBtn = panel.querySelector('.m3u8-dl-cancel-btn') as HTMLButtonElement;
if (cancelBtn) {
cancelBtn.addEventListener('click', () => {
downloadAborted = true;
log.info('Download cancelled by user');
});
}
for (const entry of detectedStreams.values()) {
addStreamToUI(entry.url, entry.parsed);
}
}
if (isTopFrame() && panel) {
addStreamToUI(url);
}