diff --git a/stremio/Dockerfile b/stremio/Dockerfile index b8f92c8..ada54e5 100644 --- a/stremio/Dockerfile +++ b/stremio/Dockerfile @@ -12,7 +12,7 @@ RUN apk add --no-cache git wget dos2unix RUN git clone https://github.com/Stremio/stremio-web.git WORKDIR /srv/stremio/dist -COPY patches.sh run.sh ./ +COPY files/*.sh ./ RUN chmod +x *.sh && dos2unix *.sh WORKDIR /srv/stremio/dist/shell diff --git a/stremio/docker-compose.dev.yml b/stremio/docker-compose.dev.yml index 2f4d071..6834f50 100644 --- a/stremio/docker-compose.dev.yml +++ b/stremio/docker-compose.dev.yml @@ -9,5 +9,7 @@ services: - '8081:8081' volumes: - ./data/:/root/.stremio-server + - ./files/patches.js:/srv/stremio/web/patches.js:ro + - ./files/patches.js:/srv/stremio/shell/patches.js:ro env_file: - .env diff --git a/stremio/docker-compose.yml b/stremio/docker-compose.yml index c25fe31..9f409f0 100644 --- a/stremio/docker-compose.yml +++ b/stremio/docker-compose.yml @@ -9,5 +9,7 @@ services: - '8081:8081' volumes: - ./data/:/root/.stremio-server + - ./files/patches.js:/srv/stremio/web/patches.js:ro + - ./files/patches.js:/srv/stremio/shell/patches.js:ro env_file: - .env diff --git a/stremio/files/patches.js b/stremio/files/patches.js new file mode 100644 index 0000000..3d55fa9 --- /dev/null +++ b/stremio/files/patches.js @@ -0,0 +1,17 @@ +/** + * + * @name Stremio JavaScript Patcher + * @author n0bodysec + * @description A simple JS that is executed on document load. You can apply custom client patches with it. + * @example https://gist.github.com/n0bodysec/2896438d8578f13c4a9e30373f7200c1 + * This script can be loaded using nginx sub_filter + * sub_filter '' ''; + * sub_filter_once on; + * + */ + +window.addEventListener('DOMContentLoaded', async (event) => +{ + const isLegacy = localStorage.streamingServerUrl !== undefined; + console.log(`[STREMIO PATCHER] Detected ${isLegacy ? 'Legacy' : 'Web'} UI`); +}); diff --git a/stremio/patches.sh b/stremio/files/patches.sh similarity index 100% rename from stremio/patches.sh rename to stremio/files/patches.sh diff --git a/stremio/run.sh b/stremio/files/run.sh similarity index 100% rename from stremio/run.sh rename to stremio/files/run.sh