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

Add isActionPopup #33

Merged
merged 3 commits into from
Nov 8, 2024
Merged

Add isActionPopup #33

merged 3 commits into from
Nov 8, 2024

Conversation

fregante
Copy link
Owner

@fregante fregante commented Nov 8, 2024

Firefox

Screenshot

Chrome

Screenshot

@@ -108,6 +109,21 @@ export const isSidePanel = once((): boolean => {
return url.pathname === location.pathname;
});

export const isActionPopup = once((): boolean => {
// Chrome-only; Firefox uses the whole window…
if (globalThis.outerHeight - globalThis.innerHeight === 14) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic number targeting Chrome. On Firefox the check only works if the URL matches the default URL (as is the case for most other checks)

@fregante fregante merged commit 5cb83d8 into main Nov 8, 2024
4 checks passed
@fregante fregante deleted the popup branch November 8, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add isActionPopup
1 participant