Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Adyoulike adapter for Safari iOS7 #1296

Merged
merged 2 commits into from
Jun 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/adapters/adyoulike.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,17 @@ var AdyoulikeAdapter = function AdyoulikeAdapter() {
Placements: placements,
};

if (performance && performance.navigation) {
body.PageRefreshed = performance.navigation.type === performance.navigation.TYPE_RELOAD;
// performance isn't supported by mobile safari iOS7. window.performance works, but
// evaluates to true on a unit test which expects false.
//
// try/catch was added to un-block the Prebid 0.25 release, but the adyoulike adapter
// maintainers should revisit this and see if it's really what they want.
try {
if (performance && performance.navigation) {
body.PageRefreshed = performance.navigation.type === performance.navigation.TYPE_RELOAD;
}
} catch (e) {
body.PageRefreshed = false;
}

return JSON.stringify(body);
Expand Down