Rework title of built-in player

This commit is contained in:
bytedream 2022-07-16 02:32:23 +02:00
parent c5f4f8b246
commit 424e34190c
3 changed files with 4 additions and 3 deletions

View File

@ -20,7 +20,7 @@ async function main() {
} }
const url = await match.match(re) const url = await match.match(re)
location.assign(chrome.runtime.getURL(`ui/player/player.html?id=${match.id}&url=${encodeURIComponent(url)}`)) location.assign(chrome.runtime.getURL(`ui/player/player.html?id=${match.id}&url=${encodeURIComponent(url)}&domains=${window.location.host}`))
} }
main() main()

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>HLS</title> <title>Stream Bypass</title>
<link rel="stylesheet" href="player.css"> <link rel="stylesheet" href="player.css">
<script src="player.js" defer></script> <script src="player.js" defer></script>
</head> </head>

View File

@ -65,13 +65,14 @@ async function main() {
const urlQuery = new URLSearchParams(window.location.search) const urlQuery = new URLSearchParams(window.location.search)
const id = urlQuery.get('id') const id = urlQuery.get('id')
const url = urlQuery.get('url') const url = urlQuery.get('url')
const domain = urlQuery.get('domain')
const match = matches.find((m) => m.id === id) const match = matches.find((m) => m.id === id)
if (match === undefined) { if (match === undefined) {
show_message(`Invalid id: ${id}. Please report this <a href="https://github.com/ByteDream/stream-bypass/issues/new">here</a>`) show_message(`Invalid id: ${id}. Please report this <a href="https://github.com/ByteDream/stream-bypass/issues/new">here</a>`)
return return
} }
document.title = match.name document.title = `Stream Bypass (${domain})`
url.endsWith('.m3u8') ? await play_hls(url, match) : await play_native(url, match) url.endsWith('.m3u8') ? await play_hls(url, match) : await play_native(url, match)
} }