3 Commits

Author SHA1 Message Date
mrjvs
d989fd1ee8 Merge pull request #16 from movie-web/dev
Version 1.1 - Headers and Permissions update
2024-02-10 21:10:47 +01:00
mrjvs
2ea2208dea Merge pull request #11 from movie-web/dev
Extension v1.0.3
2024-01-31 20:08:34 +01:00
William Oldham
6a3d32dcc3 Merge pull request #9 from movie-web/dev
Extension v1.0.2
2024-01-25 21:39:15 +00:00
6 changed files with 18 additions and 35 deletions

10
.github/SECURITY.md vendored
View File

@@ -2,9 +2,13 @@
## Supported Versions ## Supported Versions
The latest version of movie-web is the only version that is supported, as it is the only version that is being actively developed. The movie-web maintainers only support the latest version of movie-web published at https://movie-web.app.
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
You can contact the movie-web maintainers to report a vulnerability: There are two ways you can contact the movie-web maintainers to report a vulnerability:
- Report the vulnerability in the [movie-web Discord server](https://movie-web.github.io/links/discord) - Email [security@movie-web.app](mailto:security@movie-web.app)
- Report the vulnerability in the [movie-web Discord server](https://discord.movie-web.app)

View File

@@ -1,7 +1,7 @@
{ {
"name": "@movie-web/extension", "name": "@movie-web/extension",
"displayName": "movie-web extension", "displayName": "movie-web extension",
"version": "1.1.1", "version": "1.1.0",
"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": {

View File

@@ -3,7 +3,6 @@ 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';
@@ -53,11 +52,13 @@ 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);
await setDynamicRules({ if (Object.keys(req.body.headers).length > 0) {
ruleId: MAKE_REQUEST_DYNAMIC_RULE, await setDynamicRules({
targetDomains: [new URL(url).hostname], ruleId: MAKE_REQUEST_DYNAMIC_RULE,
requestHeaders: req.body.headers, targetDomains: [new URL(url).hostname],
}); requestHeaders: req.body.headers,
});
}
const response = await fetch(url, { const response = await fetch(url, {
method: req.body.method, method: req.body.method,
@@ -70,9 +71,6 @@ 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({

View File

@@ -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://mw.lonelil.ru'; const redirectUrl = queryParams.get('redirectUrl') ?? 'https://movie-web.app';
const domain = makeUrlIntoDomain(redirectUrl); const domain = makeUrlIntoDomain(redirectUrl);
const redirectBack = () => { const redirectBack = () => {

View File

@@ -1,11 +1,3 @@
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;
}
};

View File

@@ -3,14 +3,7 @@ import { useStorage } from '@plasmohq/storage/hook';
import { makeUrlIntoDomain } from '~utils/domains'; import { makeUrlIntoDomain } from '~utils/domains';
export const DEFAULT_DOMAIN_WHITELIST = [ export const DEFAULT_DOMAIN_WHITELIST = ['movie-web.app', 'dev.movie-web.app'];
'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();
@@ -38,9 +31,5 @@ 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);
const currentDomain = makeUrlIntoDomain(url); if (!isWhiteListed) throw new Error('Domain is not whitelisted');
if (!isWhiteListed)
throw new Error(
`${currentDomain} is not whitelisted. Open the extension and click on the power button to whitelist the site.`,
);
}; };