[JS Tracking Client] Safari iframe cross-domain error "Blocked a frame with origin..." #12972
Labels
Potential Bug
Something that might be a bug, but needs validation and confirmation it can be reproduced.
Waiting for user feedback
Indicates the Matomo team is waiting for feedback from the author or other users.
Milestone
When loading Matomo 3.5.0's piwik.js tracking client script into an HTML file that is loaded into an iframe on a different domain — Safari 11.1 (MacOS 10.13.4) throws the error below. See example CodePen link which loads the Matomo site into an iframe. This is a generalized use case for a widget app with Matomo tracking that would load onto a client domain.
https://codepen.io/jfroom/pen/YLbpWa
The issue is thrown by
frameElement = windowAlias.frameElement;
within /js/piwik.js#isInsideAnIframe.From my cursory searching, the approaches within this function must have worked fine in the past. Recent Safari however (which has tightened security overall), doesn't seem to allow for try/catch silencing of the error.
Piwik continues to send tracking events after this error is thrown, but the
isInsideAnIframe
method returns false which may be causing other issues in the tracking code related to the heartbeat.Ideally, this error would also not be thrown on client websites that piwik/matomo tracker is iframed into.
The text was updated successfully, but these errors were encountered: