Static 3rd party library version

This commit is contained in:
bytedream 2021-11-18 20:34:22 +01:00
parent e41bc2b8ef
commit d93a5ea784
5 changed files with 21 additions and 25 deletions

View File

@ -38,10 +38,10 @@ Supported streaming providers (for a complete list of all supported websites, se
</details> </details>
The addon was tested on The addon was tested on
- Firefox (94.0b9) - Firefox (95.0b8)
- Ungoogled Chromium (94.0) - Ungoogled Chromium (94.0)
- Vivaldi (4.3) - Vivaldi (4.3)
- Opera (80.0) - Opera (81.0)
## Installing ## Installing

View File

@ -1,9 +1,11 @@
#!/usr/bin/python3 #!/usr/bin/python3
import argparse import argparse
import io
import json import json
import sys import sys
import urllib.request import urllib.request
import zipfile
from pathlib import Path from pathlib import Path
import re import re
import shutil import shutil
@ -36,13 +38,6 @@ def write_manifest():
for content_script in manifest['content_scripts']: for content_script in manifest['content_scripts']:
content_script['matches'] = [f'*://{match}/*' for match in matches] content_script['matches'] = [f'*://{match}/*' for match in matches]
domains = []
for match in matches:
toplevel = match.split('.')[-1]
if toplevel not in domains:
domains.append(toplevel)
manifest['content_security_policy'] = f"script-src 'self' blob: https://cdn.jsdelivr.net https://unpkg.com {' '.join(f'*.{toplevel}' for toplevel in domains)}; object-src 'self'"
json.dump(manifest, open('src/manifest.json', 'w'), indent=2) json.dump(manifest, open('src/manifest.json', 'w'), indent=2)
@ -118,15 +113,17 @@ def copy_built():
ext_path = Path('build', 'ext') ext_path = Path('build', 'ext')
if not ext_path.is_dir(): if not ext_path.is_dir():
ext_path.mkdir() ext_path.mkdir()
for name, url in {
'hls.js': 'https://cdn.jsdelivr.net/npm/hls.js@latest', # download hls.js (version 1.1.1)
'popper.js': 'https://unpkg.com/@popperjs/core@2', with zipfile.ZipFile(io.BytesIO(urllib.request.urlopen('https://github.com/video-dev/hls.js/releases/download/v1.1.1/release.zip').read())) as z:
'tippy.js': 'https://unpkg.com/tippy.js@6' open(ext_path.joinpath('hls.light.min.js'), 'wb').write(z.read('dist/hls.light.min.js'))
}.items(): z.close()
with open(ext_path.joinpath(name), 'wb') as f:
ext_js = urllib.request.urlopen(url) # download popperjs core (version 2.10.2)
f.write(ext_js.read()) open(ext_path.joinpath('popper.min.js'), 'wb').write(urllib.request.urlopen('https://unpkg.com/@popperjs/core@2.10.2/dist/umd/popper.min.js').read())
f.close()
# download tippy.js (version 6.3.7)
open(ext_path.joinpath('tippy-bundle.umd.min.js'), 'wb').write(urllib.request.urlopen('https://unpkg.com/tippy.js@6.3.7/dist/tippy-bundle.umd.min.js').read())
def clean_build(): def clean_build():

View File

@ -3,7 +3,7 @@
"name": "Stream Bypass", "name": "Stream Bypass",
"author": "ByteDream", "author": "ByteDream",
"description": "A multi-browser addon / extension for multiple streaming providers which redirects directly to the source video.", "description": "A multi-browser addon / extension for multiple streaming providers which redirects directly to the source video.",
"version": "1.3.0", "version": "1.4.0",
"homepage_url": "https://github.com/ByteDream/stream-bypass", "homepage_url": "https://github.com/ByteDream/stream-bypass",
"browser_specific_settings": { "browser_specific_settings": {
"gecko": { "gecko": {
@ -39,7 +39,7 @@
"permissions": [ "permissions": [
"storage" "storage"
], ],
"content_security_policy": "script-src 'self' blob: https://cdn.jsdelivr.net https://unpkg.com *.io *.to *.co *.com *.me *.pro *.net *.st *.sx; object-src 'self'", "content_security_policy": "script-src 'self' blob:; object-src 'self'",
"browser_action": { "browser_action": {
"default_icon": "icons/stream-bypass.png", "default_icon": "icons/stream-bypass.png",
"default_title": "Stream Bypass", "default_title": "Stream Bypass",

View File

@ -4,9 +4,8 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Title</title> <title>Title</title>
<link rel="stylesheet" href="popup.css"> <link rel="stylesheet" href="popup.css">
<script src="../ext/popper.js"></script> <script src="../ext/popper.min.js"></script>
<script src="../ext/popper.js"></script> <script src="../ext/tippy-bundle.umd.min.js"></script>
<script src="../ext/tippy.js"></script>
<script src="../match.js"></script> <script src="../match.js"></script>
</head> </head>
<body> <body>

View File

@ -3,11 +3,11 @@
<head> <head>
<title>m3u8</title> <title>m3u8</title>
<link rel="stylesheet" href="/res/hls.css"> <link rel="stylesheet" href="/res/hls.css">
<script src="/ext/hls.js"></script> <script src="/ext/hls.light.min.js"></script>
</head> </head>
<body> <body>
<video id="video"></video> <video id="video"></video>
<p id="message" hidden></p> <p id="message" hidden></p>
<script src="/res/hls.js"></script> <script src="/res/hls.light.min.js"></script>
</body> </body>
</html> </html>