Added native m3u8 / hls streaming

This commit is contained in:
2021-10-23 00:13:53 +02:00
parent 2e13586ebb
commit 9929c48761
6 changed files with 53 additions and 2 deletions

View File

@ -28,11 +28,13 @@ chrome.storage.local.get(['all', 'disabled'], function (result) {
if (regex === null) {
location.assign(document.body.innerHTML)
} else {
location.assign(hasSuffix(re[0], 'm3u8') ? `https://bharadwajpro.github.io/m3u8-player/player/#${re[0]}`: re[0])
// @ts-ignore
location.assign(hasSuffix(re[0], 'm3u8') ? chrome.runtime.getURL(`res/hls.html#${re[0]}`) : re[0])
}
} else {
matchClass.match(re).then(function (path) {
location.assign(hasSuffix(path, 'm3u8') ? `https://bharadwajpro.github.io/m3u8-player/player/#${path}`: path)
// @ts-ignore
location.assign(hasSuffix(path, 'm3u8') ? chrome.runtime.getURL(`res/hls.html#${path}`) : path)
})
}
}