File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 301301 Each version stores consent in localStorage under its own base-path key
302302 (e.g. /utPLSQL/develop/.__consent). Copy a non-empty consent from any
303303 other version into the current version's key before Material checks it. */
304- var baseEl = document . querySelector ( 'base' ) ;
305- if ( baseEl ) {
306- var CONSENT_SUFFIX = '.__consent' ;
307- var currentConsentKey = new URL ( baseEl . href ) . pathname + CONSENT_SUFFIX ;
308- if ( ! localStorage . getItem ( currentConsentKey ) ) {
309- for ( var i = 0 ; i < localStorage . length ; i ++ ) {
310- var k = localStorage . key ( i ) ;
311- if ( k && k !== currentConsentKey && k . endsWith ( CONSENT_SUFFIX ) ) {
312- var val = localStorage . getItem ( k ) ;
313- if ( val && val !== '{}' ) {
314- localStorage . setItem ( currentConsentKey , val ) ;
315- break ;
316- }
304+ var CONSENT_SUFFIX = '.__consent' ;
305+ var currentConsentKey = location . pathname + CONSENT_SUFFIX ;
306+ if ( ! localStorage . getItem ( currentConsentKey ) ) {
307+ for ( var i = 0 ; i < localStorage . length ; i ++ ) {
308+ var k = localStorage . key ( i ) ;
309+ if ( k && k !== currentConsentKey && k . endsWith ( CONSENT_SUFFIX ) ) {
310+ var val = localStorage . getItem ( k ) ;
311+ if ( val && val !== '{}' ) {
312+ localStorage . setItem ( currentConsentKey , val ) ;
313+ break ;
317314 }
318315 }
319316 }
You can’t perform that action at this time.
0 commit comments