Se connecter

Se connecter

'; window._nslWebViewNoticeElement.insertAdjacentHTML("afterbegin", webviewNoticeHTML); document.body.appendChild(window._nslWebViewNoticeElement); } }); } } window._nslDOMReady(function () { window.nslRedirect = function (url) { if (scriptOptions._redirectOverlay) { const overlay = document.createElement('div'); overlay.id = "nsl-redirect-overlay"; laissez overlayHTML = ''; const overlayContainer = "
", overlayContainerClose = "
", superpositionSpinner = "
", titre de superposition = "

" + scriptOptions._localizedStrings.redirect_overlay_title + "

", overlayText = "

" + scriptOptions._localizedStrings.redirect_overlay_text + "

"; switch (scriptOptions._redirectOverlay) { case "overlay-only": break; case "overlay-with-spinner": overlayHTML = overlayContainer + overlaySpinner + overlayContainerClose; break; par défaut : overlayHTML = overlayContainer + overlaySpinner + overlayTitle + overlayText + overlayContainerClose ; break; } overlay.insertAdjacentHTML("afterbegin", overlayHTML); document.body.appendChild(overlay); document.addEventListener('click', function (e) { if (e.target) { const buttonLinkElement = e. target.closest('a[data-plugin="nsl"][data-action="connect"] ') || "link"]'); if (buttonLinkElement) { if (lastPopup && !lastPopup.closed) { e. += '?'; } const redirectTo = boutonLinkElement.dataset.redirect; if (redirectTo === 'actuel') { href += 'redirect=' + encodeURIComponent(window.location.href) + '&'; } else if (redirectTo && redirectTo !== '') { href += 'redirect=' + encodeURIComponent(redirectTo) + '&'; } if (targetWindow !== 'prefer-same-window' && checkWebView()) { targetWindow = 'prefer-same-window'; } if (targetWindow === 'prefer-popup') { lastPopup = NSLPopup(href + 'display=popup', 'nsl-social-connect', boutonLinkElement.dataset.popupwidth, boutonLinkElement.dataset.popupheight); if (lastPopup) { succès = vrai ; e.preventDefault(); } } else if (targetWindow === 'prefer-new-tab') { const newTab = window.open(href + 'display=popup', '_blank'); if (newTab) { if (window.focus) { newTab.focus(); } succès = vrai ; window._nslHasOpenedPopup = true; e.preventDefault(); } } if (!success) { window.location = href; e.preventDefault(); } } } } }); laissez boutonCountChanged = false; const googleLoginButtons = document.querySelectorAll(' a[data-plugin="nsl"][data-provider="google"]'); if (googleLoginButtons.length && checkWebView()) { googleLoginButtons.forEach(function (googleLoginButton) { if (scriptOptions._unsupportedWebviewBehavior === 'disable-button') { DisableButtonInWebView(googleLoginButton); } else { googleLoginButton.remove(); buttonCountChanged = vrai ; } }); } const facebookLoginButtons = document.querySelectorAll(' a[data-plugin="nsl"][data-provider="facebook"]'); if (facebookLoginButtons.length && checkWebView() && /Android/.test(window.navigator.userAgent) && !isAllowedWebViewForUserAgent('facebook')) { facebookLoginButtons.forEach(function (facebookLoginButton) { if (scriptOptions._unsupportedWebviewBehavior === ' désactiver-bouton') { désactiverButtonInWebView(facebookLoginButton); } else { facebookLoginButton.remove(); } const séparateurs = document.querySelectorAll('div.nsl-separator'); if (buttonCountChanged && separators.length) { separators.forEach(function (separator) { const separatorParentNode = separator.parentNode; if (separatorParentNode) { const separatorButtonContainer = separatorParentNode.querySelector('div.nsl-container-buttons'); if ( separatorButtonContainer && !separatorButtonContainer.hasChildNodes()) { separator.remove(); /** * Cross-Origin-Opener-Policy a bloqué l'accès à l'ouvreur */ if (typeof BroadcastChannel === "function") { const _nslLoginBroadCastChannel = new BroadcastChannel('nsl_login_broadcast_channel'); _nslLoginBroadCastChannel.onmessage = (event) => { if (window?._nslHasOpenedPopup && event.data?.action === 'redirect') { window._nslHasOpenedPopup = false; const url = event.data?.href; _nslLoginBroadCastChannel.close(); if (typeof window.nslRedirect === 'function') { window.nslRedirect(url); } autre { window.opener.location = url; } } } ; }})();