Skip to content

Commit

Permalink
Safari bug: null is not an object (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonvogt committed Aug 25, 2024
1 parent 7e594db commit bb79fa1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,11 @@ const renderDetailPanel = () => {
const listenForEvents = () => {
MONITORING_EVENTS.forEach((eventName) => {
window.addEventListener(eventName, (event) => {
handleMonitoredEvent(eventName, event)
// For some unknown reason, we can't use the event itself in Safari, without loosing custom properties, like event.detail.
// The only hacky workaround that seems to work is to use a setTimeout with some delay. (Issue#73)
setTimeout(() => {
handleMonitoredEvent(eventName, event)
}, 100)
})
})
}
Expand Down

0 comments on commit bb79fa1

Please sign in to comment.