Created
November 11, 2019 17:13
-
-
Save vmlinz/87599cbfc7f5c745bf021ac6fc0e1f8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function move_next(a, obj) { | |
{ | |
if (!Object.keys) { | |
Object.keys = function (obj) { | |
var keys = []; | |
for (var i in obj) { | |
if (obj.hasOwnProperty(i)) { | |
keys.push(i); | |
} | |
} | |
return keys; | |
}; | |
} | |
// 7. update offer click url | |
var redirect_url = window.redirect_url; | |
if (obj !== undefined) { | |
redirect_url += '&' + Object.keys(obj).map(k => k + '=' + encodeURIComponent(obj[k])).join('&'); | |
} | |
// 8. update prelanding redirect url, often for teaser pages | |
var background_url = window.background_url; | |
if (background_url === "" && window.sawpp !== true && window.dpush !== true) { | |
if (window.domain_has_valid_cert === true && | |
location.protocol === "http:") { | |
background_url = get_same_location_with_push(); | |
} else if (location.protocol === "https:") { | |
setTimeout(function () { | |
window.show_pushwru_show && window.show_pushwru_show(); | |
}, 1); | |
} | |
} | |
if (background_url !== '') { | |
location.replace(background_url); | |
} | |
$(window).off("beforeunload"); | |
a.preventDefault(); | |
a.stopPropagation(); | |
var open_target = ''; | |
open_target === 'self' ? | |
window.open(redirect_url, "_self") : | |
window.open(redirect_url); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment