Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Branding</title>
  6. <script src="https://yastatic.net/pcode/adfox/loader.js"></script>
  7. <style>
  8. html, body {
  9. margin: 0;
  10. padding: 0;
  11. width: 100%;
  12. height: 100%;
  13. }
  14.  
  15. #adfox_1488885316723718 {
  16. height: 100%;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <div id="adfox_1488885316723718"></div>
  22. <script>
  23. (function() {
  24. var regPuid1 = new RegExp(".*puid1=([^&#]*)");
  25. var puid1 = regPuid1.exec(document.location.search);
  26. if (puid1) {
  27. puid1 = puid1[1];
  28. }
  29.  
  30. window.addEventListener("message", setLocation);
  31.  
  32. function setLocation(evt) {
  33. // For Chrome, the origin property is in the event.originalEvent object.
  34. // See: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
  35. var origin = evt.origin || evt.originalEvent.origin;
  36. if (!isValidedDomain(origin)) {
  37. return;
  38. }
  39.  
  40. var messages = evt.data.split(";");
  41.  
  42. if (messages.length && messages[0] === "setLocation" && messages[1].indexOf("http") === 0) {
  43. getAd(messages[1], origin);
  44. window.removeEventListener("message", setLocation);
  45. }
  46. }
  47.  
  48. function isValidedDomain(domain) {
  49. return /(^|:\/\/|\.)yandex\.(com|ru|ua|by|kz|com\.tr)$/.test(domain);
  50. }
  51.  
  52. function getAd(dl, origin) {
  53. window.Ya.adfoxCode.create({
  54. ownerId: 256152,
  55. containerId: "adfox_1488885316723718",
  56. params: {
  57. puid1: puid1,
  58. puid10: origin,
  59. dl: dl,
  60. pp: "g",
  61. ps: "clni",
  62. p2: "foom"
  63. }
  64. });
  65. }
  66. })();
  67. </script>
  68. </body>
  69. </html>%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement