Skip to content

Commit 5397ef2

Browse files
Kapil Tuptewarpm-azhar-mulla
Kapil Tuptewar
authored and
pm-azhar-mulla
committed
Added new field to floors config
1 parent a096ab6 commit 5397ef2

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

src_new/adapters/prebid.js

+3
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,9 @@ function getFloorsConfiguration(prebidConfig){
10701070
auctionDelay: CONFIG.getFloorAuctionDelay(),
10711071
endpoint:{
10721072
url: CONFIG.getFloorJsonUrl()
1073+
},
1074+
additionalSchemaFields : {
1075+
browser : util.getBrowser
10731076
}
10741077
}
10751078
}

src_new/util.js

+19
Original file line numberDiff line numberDiff line change
@@ -1935,3 +1935,22 @@ exports.applyCustomParamValuesfApplicable = function(params) {
19351935
}
19361936
}
19371937
}
1938+
1939+
exports.getBrowser = function() {
1940+
var userAgent = navigator.userAgent;
1941+
var browserName;
1942+
if (userAgent.match(/chrome|chromium|crios/i)) {
1943+
browserName = "chrome";
1944+
} else if (userAgent.match(/firefox|fxios/i)) {
1945+
browserName = "firefox";
1946+
} else if (userAgent.match(/safari/i)) {
1947+
browserName = "safari";
1948+
} else if (userAgent.match(/opr\//i)) {
1949+
browserName = "opera";
1950+
} else if (userAgent.match(/edg/i)) {
1951+
browserName = "edge";
1952+
} else {
1953+
browserName="No browser detection";
1954+
}
1955+
return browserName;
1956+
}

test/adapters/prebid.spec.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,10 @@ describe('ADAPTER: Prebid', function() {
950950
auctionDelay: 100,
951951
endpoint:{
952952
url: "externalFloor.json"
953-
}
953+
},
954+
additionalSchemaFields : {
955+
browser : UTIL.getBrowser
956+
}
954957
}
955958
function onSSOLogin() {};
956959
window.owpbjs = {

0 commit comments

Comments
 (0)