js2.corriereobjects.it Open in urlscan Pro
2600:9000:223c:1800:1a:df3f:93c0:93a1  Public Scan

URL: https://js2.corriereobjects.it/volocom/volocom.js
Submission: On October 16 via api from IT — Scanned from IT

Form analysis 0 forms found in the DOM

Text Content

"use strict";

var getCookieByName = function getCookieByName(name) {
  var getAllCookie = document.cookie;
  var emailCookie = getAllCookie.split("; " + name + "=");
  return emailCookie.pop().split("|").shift().replace('"', '');
};

var setPermission = function setPermission() {
  var hideSections = []; // desktop and mobile

  if (window.device == "desktop" || currentDevice == "desktop") {
    hideSections = [{
      newsletter: '#menu-user',
      profilo: '.profilo-menu',
      servizi: '.bck-servizi',
      commenti: '.social_bar',
      commentiBottom: '.passaparola',
      banPromoPayw: '#banPromoPayw',
      newsletterarticolo: '.box_art_19',
      socialLocal: '.web_widget_socialBar',
      socialLocalart: '.socialbar_container',
      notifichepush: '.box_generico_3col'
    }, {
      serviziOld: '.servizi',
      socialLocalartOld: '.socialbar_container'
    }];
  } else {
    hideSections = [{
      serviziOld: '.servizi',
      socialLocalartOld: '.socialbar_container',
      profilo: '.class-mob',
      privacy: '.class-mob',
      acquisti: '.class-mob',
      newsletter: '.class-mob',
      commenti: '.class-mob',
      vas: '.class-mob'
    }, {}];
  }

  hideSections.forEach(function (section, index) {
    console.log(section, index);

    for (var property in section) {
      //console.log(section[property]);
      var selectedSec = document.querySelector(section[property]);

      if (selectedSec) {
        selectedSec.style.display = "none";
        selectedSec.remove();
      } else {
        console.log("Section not found: ".concat(property, ": ").concat(section[property]));
      }
    }
  });
};

var getUserType = function getUserType() {
  var userEmail = getCookieByName('rcsLogin'); //const regexIsEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;

  var regexIsEmailVolocom = /^[A-Za-z0-9._%+-]+@extpartner.rcsmg$/;

  if (userEmail.match(regexIsEmailVolocom)) {
    console.log("Email is present: ".concat(userEmail));
    setTimeout(function(){ setPermission(); }, 2000);

    
  } else {
    console.log("Email not present: ".concat(userEmail));
  }
}; // Call function


getUserType();