mirror of
https://github.com/movie-web/extension.git
synced 2025-09-13 12:13:24 +00:00
Remove lonelil as a redirect, Firefox didn't like
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
import { Button } from '~components/Button';
|
import { Button } from '~components/Button';
|
||||||
import { usePermission } from '~hooks/usePermission';
|
import { usePermission } from '~hooks/usePermission';
|
||||||
import { makeUrlIntoDomain } from '~utils/domains';
|
import { makeUrlIntoDomain } from '~utils/domains';
|
||||||
@@ -8,11 +10,27 @@ 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') ?? undefined;
|
||||||
const domain = makeUrlIntoDomain(redirectUrl);
|
const domain = redirectUrl ? makeUrlIntoDomain(redirectUrl) : undefined;
|
||||||
|
|
||||||
|
if (!domain) {
|
||||||
|
return (
|
||||||
|
<div className="permission-grant container">
|
||||||
|
<div className="inner-container">
|
||||||
|
<div className="permission-card">
|
||||||
|
<h1 className="color-white">Permission</h1>
|
||||||
|
<p className="text-color" style={{ textAlign: 'center' }}>
|
||||||
|
No domain found to grant permission to.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const redirectBack = () => {
|
const redirectBack = () => {
|
||||||
chrome.tabs.getCurrent((tab) => {
|
chrome.tabs.getCurrent((tab) => {
|
||||||
|
if (!tab?.id) return;
|
||||||
chrome.tabs.update(tab.id, { url: redirectUrl });
|
chrome.tabs.update(tab.id, { url: redirectUrl });
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user