Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@lexical/devtools): Fix of the edge cases with restricted pages in Edge/FF #5945

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export default class ActionIconWatchdog {

private isRestrictedBrowserPage(url: string | undefined) {
return (
!url || ['chrome:', 'about:', 'file:'].includes(new URL(url).protocol)
!url ||
['chrome:', 'about:', 'file:', 'edge:'].includes(new URL(url).protocol)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ function App({tabID}: Props) {
const [errorMessage, setErrorMessage] = useState('');

const {lexicalState} = useExtensionStore();
const states = lexicalState[tabID] ?? {};
const states = lexicalState[tabID];
const lexicalCount = Object.keys(states ?? {}).length;

return (
return lexicalState[tabID] === null ? (
<Alert status="warning">
<AlertIcon />
This is a restricted browser page. Lexical DevTools cannot access this
page.
</Alert>
) : (
<>
<Flex>
<Box p="4">
Expand Down Expand Up @@ -85,7 +91,7 @@ function App({tabID}: Props) {
) : (
<Alert status="info">
<AlertIcon />
No Lexical editor found on the page.
No Lexical editors found on the page.
</Alert>
)}
</Box>
Expand Down
Loading