`;
document.getElementsByTagName("body")[0].insertAdjacentHTML("beforeend", pfxhtml);
var set_interval_id = setInterval(findTargetElement, 200);
var retry_counter = 0;
function findTargetElement() {
console.info("%c MNads ", adLabel, "PFX_retry_counter : ", retry_counter);
retry_counter++;
// è¦ç´ ãMAXãªãã©ã¤å¤ã«ãªã£ã¦ãè¦ã¤ãããªãå ´åãã¤ã³ã¿ã¼ãã«ãåé¤
if (retry_counter > 30) {
clearInterval(set_interval_id);
overlayBids();
console.info("%c MNads ", adLabel, "PFX_retry_counter : timeout");
}
var diff_container_elements = null;
var pfxiframe = document.getElementsByClassName("profitx-ad-frame-markup pfx-renderer-observed")[0];
if (pfxiframe) {
if (pfxiframe.contentWindow.document) {
diff_container_elements = pfxiframe.contentWindow.document.getElementById('pfx_interstitial_close');
}
}
if (diff_container_elements != null) {
clearInterval(set_interval_id);
diff_container_elements.addEventListener('mouseup', function() {
overlayBids();
});
console.info("%c MNads ", adLabel, "PFX_retry_counter : stopped");
}
}
}
function interstitialRise() {
if (document.referrer !== 'https://news.yahoo.co.jp/') {
console.info("%c MNads ", adLabel, "interstitial : RISE");
var riseDiv = document.createElement('div');
riseDiv.id = "ads-ADU-GFE7BBGX";
var body = document.getElementsByTagName("body")[0];
body.appendChild(riseDiv);
(function(w,d,s,i){w.adunitlength?w.adunitlength.push('ADU-GFE7BBGX'):w.adunitlength=['ADU-GFE7BBGX'];var f=d.getElementsByTagName(s)[0],j=d.createElement(s);j.async=true;j.src='https://rise.enhance.co.jp/adu.js?id='+i + '&matwName=matw_uuid' + '&clientTime=' + (new Date()).getTime();f.parentNode.insertBefore(j,f);})(window,document,'script','ADU-GFE7BBGX');
var set_interval_id = setInterval(findTargetElement, 200);
var retry_counter = 0;
function findTargetElement() {
console.info("%c MNads ", adLabel, "RISE_retry_counter : ", retry_counter);
retry_counter++;
// è¦ç´ ãMAXãªãã©ã¤å¤ã«ãªã£ã¦ãè¦ã¤ãããªãå ´åãã¤ã³ã¿ã¼ãã«ãåé¤
if (retry_counter > 30) {
clearInterval(set_interval_id);
overlayBids();
console.info("%c MNads ", adLabel, "RISE_retry_counter : timeout");
}
var diff_container_elements = null;
var risearea = document.getElementById('rise-interstitial-area');
if (risearea) {
var riseiframe = risearea.getElementsByTagName('iframe')[0];
if (riseiframe) {
if (riseiframe.contentWindow.document.getElementById('rise-close-text-base')) {
diff_container_elements = riseiframe.contentWindow.document.getElementById('rise-close-text-base');
}
}
}
if (diff_container_elements !== null) {
clearInterval(set_interval_id);
diff_container_elements.addEventListener('mouseup', function() {
overlayBids();
});
console.info("%c MNads ", adLabel, "RISE_retry_counter : stopped");
}
}
} else {
overlayBids();
}
}
function overlayBids() {
var lazyLabel = 'color: #fff; background: #01c4cc; padding: 1px 4px; border-radius: 3px;';
var overlayAdSlots = [];
var overlayBiddingSlots = [];
googletag.cmd.push(function () {
overlayAdSlots[0] = googletag.defineSlot('/21662775423/mnpc/p1wipe', [1, 1], 'mnpc-p1wipe').addService(googletag.pubads());
overlayBiddingSlots.push(overlayAdSlots[0]);
});
var overlayBidders = ['prebid'];
var overlayRequestManager = {
adserverRequestSent: false,
};
overlayBidders.forEach(function (bidder) {
overlayRequestManager[bidder] = false;
});
function overlayAllBiddersBack() {
var overlayAllBiddersBack = overlayBidders
.map(function (bidder) { return overlayRequestManager[bidder]; })
.filter(function (bool) { return bool; })
.length === overlayBidders.length;
return overlayAllBiddersBack;
}
function overlayHeaderBidderBack(bidder) {
if (overlayRequestManager.adserverRequestSent === true) {
return;
}
if (bidder === 'prebid') {
overlayRequestManager.prebid = true;
console.log("%c MNads ", adLabel, " Overlay : PB recieved ");
}
if (overlayAllBiddersBack()) {
console.log("%c MNads ", adLabel, " Overlay : All Bid recieved ");
overlaySendAdserverRequest();
}
}
function overlaySendAdserverRequest() {
if (overlayRequestManager.adserverRequestSent === true) {
return;
}
if (overlayRequestManager.prebid !== true) {
console.info("%c MNads ", adLabel, "Overlay : PB Timeout");
}
overlayRequestManager.adserverRequestSent = true;
}
if (!isInterstitialRestricted()) {
googletag.cmd.push(function () {
googletag.pubads().refresh(overlayBiddingSlots);
});
}
function overlayRequestBids() {
pbjs.que.push(function () {
pbjs.rp.requestBids({
callback: function (bidResponses) {
overlayHeaderBidderBack('prebid');
},
gptSlotObjects: overlayBiddingSlots
});
});
}
overlayRequestBids();
}
ã¾ãã©ãªãã¡ããªã¼ï¼æ°çè¨äºé ï¼