firefox addon fix

This commit is contained in:
bytedream 2021-11-06 13:40:06 +01:00
parent 1e7b9b3d8d
commit 052c0d1e78
5 changed files with 21 additions and 6 deletions

View File

@ -3,6 +3,7 @@
import argparse
import json
import sys
import urllib.request
from pathlib import Path
import re
import shutil
@ -114,6 +115,19 @@ def copy_built():
elif file.suffix != '.ts':
shutil.copy(str(file), str(build_file))
ext_path = Path('build', 'ext')
if not ext_path.is_dir():
ext_path.mkdir()
for name, url in {
'hls.js': 'https://cdn.jsdelivr.net/npm/hls.js@latest',
'popper.js': 'https://unpkg.com/@popperjs/core@2',
'tippy.js': 'https://unpkg.com/tippy.js@6'
}.items():
with open(ext_path.joinpath(name), 'wb') as f:
ext_js = urllib.request.urlopen(url)
f.write(ext_js.read())
f.close()
def clean_build():
for file in Path('src').rglob('*'):

View File

@ -2,8 +2,8 @@
"manifest_version": 2,
"name": "Stream Bypass",
"author": "ByteDream",
"description": "",
"version": "1.2.0",
"description": "A multi-browser addon / extension for multiple streaming providers which redirects directly to the source video.",
"version": "1.3.0",
"homepage_url": "https://github.com/ByteDream/stream-bypass",
"browser_specific_settings": {
"gecko": {

View File

@ -4,8 +4,9 @@
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="popup.css">
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script src="../ext/popper.js"></script>
<script src="../ext/popper.js"></script>
<script src="../ext/tippy.js"></script>
<script src="../match.js"></script>
</head>
<body>

View File

@ -3,7 +3,7 @@
<head>
<title>m3u8</title>
<link rel="stylesheet" href="/res/hls.css">
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<script src="/ext/hls.js"></script>
</head>
<body>
<video id="video"></video>

View File

@ -1,6 +1,6 @@
function showMessage(message: string) {
let messageElement = document.getElementById('message') as HTMLParagraphElement
messageElement.innerHTML = message
messageElement.innerText = message
messageElement.hidden = false
document.getElementById('video').hidden = true
}