一番下へ
このページはPC版を携帯向けに変換して表示しています。
button'; const ariaAttribute = 'aria-labelledby'; function adjustOneTrustDOM() { const 'onetrust-consent-sdk'); /* remove empty nodes */ [...(oneTrustRoot?.querySelectorAll(emptyNodeSelectors) ?? [])].filter(e => e.textContent === '').forEach(e => e.remove()); /* remove invalid aria-labelledby values */ oneTrustRoot?.querySelectorAll(ariaLabelledByButtonNodes).forEach(e => { const presentIdValue = e.getAttribute(ariaAttribute)?.split(' ').filter(label => document.getElementById(label)).join(' '); if (presentIdValue) { e.setAttribute(ariaAttribute, presentIdValue); } }); } function observeOneTrustLoaded(shouldSetOTDefaults, isConsentPresent) { const cb = (mutationList, observer) => { const => mutationRecord.type === 'childList' && mutationRecord.addedNodes.length).map(mutationRecord => [...mutationRecord.addedNodes]).flat().find(e => e.id === oneTrustConsentSdkId); if (oneTrustRoot && typeof OneTrust !== 'undefined') { monitor.loaded(true); OneTrust.OnConsentChanged(() => { const perfAllowed = decodeURIComponent(document.cookie.match('(^| )OptanonConsent=([^;]+)')?.[2])?.match('groups=([0-9:0|1,?]+)&?')?.[1]?.match('2:([0|1])')[1] === '1'; if (perfAllowed) { enableGroup('performance'); } }); if (!isConsentPresent && (shouldSetOTDefaults || 'implied consent')) { OneTrust.AllowAll(); } document.dispatchEvent(new CustomEvent('@sdtech/onetrust/loaded', {})); observer.disconnect(); adjustOneTrustDOM(); } }; const observer = new MutationObserver(cb); observer.observe(document.querySelector('body'), { childList: true }); } if (doClear) { document.cookie = 'OptanonAlertBoxClosed=; expires=Thu, 01 Jan 1970 00:00:00 UTC; samesite=lax; path=/'; } const isConsentPresent = !!decodeURIComponent(document.cookie.match('(^| )OptanonConsent=([^;]+)')?.[2])?.match('groups=([0-9:0|1,?]+)&?')?.[1]; const shouldSetOTDefaults = 'true' === 'false' && !document.cookie?.match('OptanonAlertBoxClosed='); if (shouldSetOTDefaults) { const date = new Date(); date.setFullYear(date.getFullYear() + 1); document.cookie = `OptanonAlertBoxClosed=${new Date().toISOString()}; expires=${date.toUTCString()}; samesite=lax; path=/; domain=sciencedirect.com`; } observeOneTrustLoaded(shouldSetOTDefaults, isConsentPresent, monitor); window.addOTScript = () => { const otSDK = document.createElement('script'); otSDK.setAttribute('data-cfasync', 'false'); otSDK.setAttribute('src', 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js'); otSDK.setAttribute('data-document-language', 'true'); otSDK.setAttribute('data-domain-script', '865ea198-88cc-4e41-8952-1df75d554d02'); window.addOTScript = () => {}; document.head.appendChild(otSDK); monitor.init(); }; window.addEventListener('load', () => window.addOTScript()); } if (document.location.host.match(/.sciencedirect.com$/)) { runOneTrustCookies(true, monitor); } else { window.addEventListener('load', (event) => { enableGroup('performance'); }); } }());
一番上へ TOP