Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Fix ad insertion invalid URL error
Browse files Browse the repository at this point in the history
window.URL sometimes threw an error that the URL was invalid. not sure why.

Auditors: @bbondy
  • Loading branch information
diracdeltas committed Jun 2, 2016
1 parent 4126235 commit bb4de1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,11 @@ class Frame extends ImmutableComponent {
}

insertAds (currentLocation) {
const host = new window.URL(currentLocation).hostname.replace('www.', '')
var host = urlParse(currentLocation).hostname
if (!host) {
return
}
host = host.replace('www.', '')
const adDivCandidates = adInfo[host] || []
// Call this even when there are no matches because we have some logic
// to replace common divs.
Expand Down

1 comment on commit bb4de1f

@bbondy
Copy link
Member

@bbondy bbondy commented on bb4de1f Jun 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

Please sign in to comment.