import { Button } from '~components/Button'; import { usePermission } from '~hooks/usePermission'; import { makeUrlIntoDomain } from '~utils/domains'; import './PermissionGrant.css'; export default function PermissionGrant() { const { grantPermission } = usePermission(); const queryParams = new URLSearchParams(window.location.search); const redirectUrl = queryParams.get('redirectUrl') ?? 'https://movie-web.app'; const domain = makeUrlIntoDomain(redirectUrl); const redirectBack = () => { chrome.tabs.getCurrent((tab) => { chrome.tabs.update(tab.id, { url: redirectUrl }); }); }; const handleGrantPermission = () => { grantPermission(domain).then(() => { redirectBack(); }); }; return (

Permission

The website {domain} wants to
use the extension on their page. Do you trust them?

); }