Error: Permission denied to access property 'target'

Viewed 1030

How do I determine if the subsequent code has permissions in order to avoid the following error message:

Error: Permission denied to access property 'target'

This happened in Firefox within an event handler for dragleave:

window.ondragleave = function(event)
{
 if (typeof event.target == 'object')
 {
  var droppable = element_parent(event.target, (event.target.hasAttribute && event.target.hasAttribute('data-drop')), (event.target.nodeName != 'html'));
 }
}
  • This issue is fairly rare occurring once a month across multiple domains.
  • This issue occurs in Firefox on desktops.
  • I have not personally reproduced the issue though the reports in error logs are highly reliable.

There is a Permissions API though it does not seem accessible as of Waterfox 56 / Firefox 74B at event.permissions or event.target.permissions. I have made numerous attempts to directly reproduce the issue by dragging selected and non-selected parts of the page and "leave" the cursor away from various elements, form fields and the page itself though I see this error reported once every few weeks. Suggestions?

  • No frameworks or libraries.
0 Answers
Related