Skip to content

Commit

Permalink
Make more safe for unexpected event targets
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jan 16, 2024
1 parent 5e52a43 commit 3bc3dc9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion webextensions/sidebar/event-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ export function getMouseEventDetail(event, tab) {
}

export function getEventTargetType(event) {
if (event.target.closest('.rich-confirm, #blocking-screen'))
const element = event.target.closest ?
event.target :
event.target.parentNode;
if (element.closest('.rich-confirm, #blocking-screen'))
return 'outside';

if (getTabFromEvent(event))
Expand Down

0 comments on commit 3bc3dc9

Please sign in to comment.