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>
The addon was tested on
- Firefox (94.0b9)
- Firefox (95.0b8)
- Ungoogled Chromium (94.0)
- Vivaldi (4.3)
- Opera (80.0)
- Opera (81.0)
## Installing

View File

@ -1,9 +1,11 @@
#!/usr/bin/python3
import argparse
import io
import json
import sys
import urllib.request
import zipfile
from pathlib import Path
import re
import shutil
@ -36,13 +38,6 @@ def write_manifest():
for content_script in manifest['content_scripts']:
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)
@ -118,15 +113,17 @@ def copy_built():
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()
# download hls.js (version 1.1.1)
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:
open(ext_path.joinpath('hls.light.min.js'), 'wb').write(z.read('dist/hls.light.min.js'))
z.close()
# download popperjs core (version 2.10.2)
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())
# 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():

View File

@ -3,7 +3,7 @@
"name": "Stream Bypass",
"author": "ByteDream",
"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",
"browser_specific_settings": {
"gecko": {
@ -39,7 +39,7 @@
"permissions": [
"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": {
"default_icon": "icons/stream-bypass.png",
"default_title": "Stream Bypass",

View File

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

View File

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