Sha256: 593f8125e98e25cf6f9d5772233dd61c0f6dd9e2bc356441d5b54ef7b42f7a12
Contents?: true
Size: 1.08 KB
Versions: 71
Compression:
Stored size: 1.08 KB
Contents
(function() { function ITPHelper(opts) { this.itpContent = document.getElementById('TopLevelInteractionContent'); this.itpAction = document.getElementById('TopLevelInteractionButton'); this.redirectUrl = opts.redirectUrl; } ITPHelper.prototype.redirect = function() { sessionStorage.setItem('shopify.top_level_interaction', true); window.location.href = this.redirectUrl; } ITPHelper.prototype.userAgentIsAffected = function() { return Boolean(document.hasStorageAccess); } ITPHelper.prototype.canPartitionCookies = function() { var versionRegEx = /Version\/12\.0\.?\d? Safari/; return versionRegEx.test(navigator.userAgent); } ITPHelper.prototype.setUpContent = function(onClick) { this.itpContent.style.display = 'block'; this.itpAction.addEventListener('click', this.redirect.bind(this)); } ITPHelper.prototype.execute = function() { if (!this.itpContent) { return; } if (this.userAgentIsAffected()) { this.setUpContent(); } else { this.redirect(); } } this.ITPHelper = ITPHelper; })(window);
Version data entries
71 entries across 71 versions & 2 rubygems