Skip to content

Commit

Permalink
Fix brave/brave-ios#8561: Fix issue with stats script sending empty i…
Browse files Browse the repository at this point in the history
…mage sources (brave/brave-ios#8559)

Fix issue with stats script sending empty image sources
  • Loading branch information
cuba authored Dec 14, 2023
1 parent 83dc558 commit e09c64e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ window.__firefox__.execute(function($) {
// If this `Image` instance fails to load, we can assume
// it has been blocked.
this._tpErrorHandler = $(function() {
// We don't need to send it if the src is set to ""
// (which will give us `window.location.href`)
if (this.src === window.location.href) { return }
sendMessage(this.src, "image");
});
this.addEventListener("error", this._tpErrorHandler);
Expand Down

0 comments on commit e09c64e

Please sign in to comment.