mirror of
https://github.com/movie-web/extension.git
synced 2025-09-13 14:43:24 +00:00
Compare commits
19 Commits
finalize-e
...
0801f64e1b
Author | SHA1 | Date | |
---|---|---|---|
|
0801f64e1b | ||
|
8735f7b4b2 | ||
|
90f941431c | ||
|
df05547581 | ||
|
a8e3de1451 | ||
|
1801ee238d | ||
|
434b2475cb | ||
|
50166457b8 | ||
|
e2ea8a3c7e | ||
|
213828e818 | ||
|
755bba3e1e | ||
|
e7ca90b75f | ||
|
d74f0abbf6 | ||
|
cade0b50ab | ||
|
1ac8147cdd | ||
|
6d1fa16553 | ||
|
a8417c75a3 | ||
|
abf26103e1 | ||
|
03e7649bc1 |
10
.github/SECURITY.md
vendored
10
.github/SECURITY.md
vendored
@@ -2,13 +2,9 @@
|
|||||||
|
|
||||||
## Supported Versions
|
## Supported Versions
|
||||||
|
|
||||||
The movie-web maintainers only support the latest version of movie-web published at https://movie-web.app.
|
The latest version of movie-web is the only version that is supported, as it is the only version that is being actively developed.
|
||||||
This published version is equivalent to the master branch.
|
|
||||||
|
|
||||||
Support is not provided for any forks or mirrors of movie-web.
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
There are two ways you can contact the movie-web maintainers to report a vulnerability:
|
You can contact the movie-web maintainers to report a vulnerability:
|
||||||
- Email [security@movie-web.app](mailto:security@movie-web.app)
|
- Report the vulnerability in the [movie-web Discord server](https://movie-web.github.io/links/discord)
|
||||||
- Report the vulnerability in the [movie-web Discord server](https://discord.movie-web.app)
|
|
||||||
|
4
.github/workflows/deploying.yml
vendored
4
.github/workflows/deploying.yml
vendored
@@ -94,8 +94,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||||
asset_path: ./chrome/chrome-mv3-prod.zip
|
asset_path: ./chrome/chrome-mv3-prod.zip
|
||||||
asset_name: extension-mw.chrome.crx
|
asset_name: extension-mw.chrome.zip
|
||||||
asset_content_type: application/x-chrome-extension
|
asset_content_type: application/zip
|
||||||
|
|
||||||
- name: Upload Firefox release
|
- name: Upload Firefox release
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
|
BIN
assets/active.png
Normal file
BIN
assets/active.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
BIN
assets/inactive.png
Normal file
BIN
assets/inactive.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
13
package.json
13
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@movie-web/extension",
|
"name": "@movie-web/extension",
|
||||||
"displayName": "movie-web extension",
|
"displayName": "movie-web extension",
|
||||||
"version": "1.1.0",
|
"version": "1.1.2",
|
||||||
"description": "Enhance your movie-web experience with just one click",
|
"description": "Enhance your movie-web experience with just one click",
|
||||||
"author": "movie-web",
|
"author": "movie-web",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -54,6 +54,17 @@
|
|||||||
"gecko": {
|
"gecko": {
|
||||||
"id": "{3fd86354-c73f-4395-9e26-2c5c984579bf}"
|
"id": "{3fd86354-c73f-4395-9e26-2c5c984579bf}"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"web_accessible_resources": [
|
||||||
|
{
|
||||||
|
"resources": [
|
||||||
|
"assets/active.png",
|
||||||
|
"assets/inactive.png"
|
||||||
|
],
|
||||||
|
"matches": [
|
||||||
|
"<all_urls>"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,6 +3,7 @@ import type { PlasmoMessaging } from '@plasmohq/messaging';
|
|||||||
import type { BaseRequest } from '~types/request';
|
import type { BaseRequest } from '~types/request';
|
||||||
import type { BaseResponse } from '~types/response';
|
import type { BaseResponse } from '~types/response';
|
||||||
import { removeDynamicRules, setDynamicRules } from '~utils/declarativeNetRequest';
|
import { removeDynamicRules, setDynamicRules } from '~utils/declarativeNetRequest';
|
||||||
|
import { isFirefox } from '~utils/extension';
|
||||||
import { makeFullUrl } from '~utils/fetcher';
|
import { makeFullUrl } from '~utils/fetcher';
|
||||||
import { assertDomainWhitelist } from '~utils/storage';
|
import { assertDomainWhitelist } from '~utils/storage';
|
||||||
|
|
||||||
@@ -52,13 +53,11 @@ const handler: PlasmoMessaging.MessageHandler<Request, Response<any>> = async (r
|
|||||||
const url = makeFullUrl(req.body.url, req.body);
|
const url = makeFullUrl(req.body.url, req.body);
|
||||||
await assertDomainWhitelist(req.sender.tab.url);
|
await assertDomainWhitelist(req.sender.tab.url);
|
||||||
|
|
||||||
if (Object.keys(req.body.headers).length > 0) {
|
|
||||||
await setDynamicRules({
|
await setDynamicRules({
|
||||||
ruleId: MAKE_REQUEST_DYNAMIC_RULE,
|
ruleId: MAKE_REQUEST_DYNAMIC_RULE,
|
||||||
targetDomains: [new URL(url).hostname],
|
targetDomains: [new URL(url).hostname],
|
||||||
requestHeaders: req.body.headers,
|
requestHeaders: req.body.headers,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
const response = await fetch(url, {
|
const response = await fetch(url, {
|
||||||
method: req.body.method,
|
method: req.body.method,
|
||||||
@@ -71,6 +70,9 @@ const handler: PlasmoMessaging.MessageHandler<Request, Response<any>> = async (r
|
|||||||
|
|
||||||
const cookies = await (chrome || browser).cookies.getAll({
|
const cookies = await (chrome || browser).cookies.getAll({
|
||||||
url: response.url,
|
url: response.url,
|
||||||
|
...(isFirefox() && {
|
||||||
|
firstPartyDomain: new URL(response.url).hostname,
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
res.send({
|
res.send({
|
||||||
|
@@ -36,7 +36,7 @@ export function ToggleButton(props: ToggleButtonProps) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Extension {props.active ? 'enabled' : 'disabled'} <br /> on <strong>{props.domain}</strong>
|
Extension <strong>{props.active ? 'enabled' : 'disabled'}</strong> <br /> on <strong>{props.domain}</strong>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@@ -27,6 +27,11 @@ export function useToggleWhitelistDomain(domain: string) {
|
|||||||
const { domainWhitelist, addDomain, removeDomain } = useDomainWhitelist();
|
const { domainWhitelist, addDomain, removeDomain } = useDomainWhitelist();
|
||||||
const isWhitelisted = domainWhitelist.includes(domain);
|
const isWhitelisted = domainWhitelist.includes(domain);
|
||||||
const { grantPermission } = usePermission();
|
const { grantPermission } = usePermission();
|
||||||
|
const iconPath = (chrome || browser).runtime.getURL(isWhitelisted ? 'assets/active.png' : 'assets/inactive.png');
|
||||||
|
|
||||||
|
(chrome || browser).action.setIcon({
|
||||||
|
path: iconPath,
|
||||||
|
});
|
||||||
|
|
||||||
const toggle = useCallback(() => {
|
const toggle = useCallback(() => {
|
||||||
if (!isWhitelisted) {
|
if (!isWhitelisted) {
|
||||||
|
@@ -8,7 +8,7 @@ export default function PermissionGrant() {
|
|||||||
const { grantPermission } = usePermission();
|
const { grantPermission } = usePermission();
|
||||||
|
|
||||||
const queryParams = new URLSearchParams(window.location.search);
|
const queryParams = new URLSearchParams(window.location.search);
|
||||||
const redirectUrl = queryParams.get('redirectUrl') ?? 'https://movie-web.app';
|
const redirectUrl = queryParams.get('redirectUrl') ?? 'https://mw.lonelil.ru';
|
||||||
const domain = makeUrlIntoDomain(redirectUrl);
|
const domain = makeUrlIntoDomain(redirectUrl);
|
||||||
|
|
||||||
const redirectBack = () => {
|
const redirectBack = () => {
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
export const isChrome = () => {
|
export const isChrome = () => {
|
||||||
return chrome.runtime.getURL('').startsWith('chrome-extension://');
|
return chrome.runtime.getURL('').startsWith('chrome-extension://');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const isFirefox = () => {
|
||||||
|
try {
|
||||||
|
return browser.runtime.getURL('').startsWith('moz-extension://');
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
@@ -3,7 +3,14 @@ import { useStorage } from '@plasmohq/storage/hook';
|
|||||||
|
|
||||||
import { makeUrlIntoDomain } from '~utils/domains';
|
import { makeUrlIntoDomain } from '~utils/domains';
|
||||||
|
|
||||||
export const DEFAULT_DOMAIN_WHITELIST = ['movie-web.app', 'dev.movie-web.app'];
|
export const DEFAULT_DOMAIN_WHITELIST = [
|
||||||
|
'mw.lonelil.ru',
|
||||||
|
'watch.qtchaos.de',
|
||||||
|
'bmov.vercel.app',
|
||||||
|
'stream.thehairy.me',
|
||||||
|
'scootydooter.vercel.app',
|
||||||
|
'movie-web-me.vercel.app',
|
||||||
|
];
|
||||||
|
|
||||||
export const storage = new Storage();
|
export const storage = new Storage();
|
||||||
|
|
||||||
@@ -31,5 +38,9 @@ export const isDomainWhitelisted = async (url: string | undefined) => {
|
|||||||
|
|
||||||
export const assertDomainWhitelist = async (url: string) => {
|
export const assertDomainWhitelist = async (url: string) => {
|
||||||
const isWhiteListed = await isDomainWhitelisted(url);
|
const isWhiteListed = await isDomainWhitelisted(url);
|
||||||
if (!isWhiteListed) throw new Error('Domain is not whitelisted');
|
const currentDomain = makeUrlIntoDomain(url);
|
||||||
|
if (!isWhiteListed)
|
||||||
|
throw new Error(
|
||||||
|
`${currentDomain} is not whitelisted. Open the extension and click on the power button to whitelist the site.`,
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user