hotfix(wayfinding): make sure referrerHost is assigned in v3WayfindingModal function (fixes #5732)
parent
90a740e7b4
commit
3e64fa199c
|
@ -1,5 +1,5 @@
|
||||||
// Store the host value for the current page
|
// Store the host value for the current page
|
||||||
currentPageHost = window.location.href.match(/^(?:[^\/]*\/){2}[^\/]+/g)[0];
|
const currentPageHost = window.location.href.match(/^(?:[^\/]*\/){2}[^\/]+/g)[0];
|
||||||
|
|
||||||
// Define v3-wayfinding elements
|
// Define v3-wayfinding elements
|
||||||
var wayfindingModal = document.getElementById('v3-wayfinding-modal');
|
var wayfindingModal = document.getElementById('v3-wayfinding-modal');
|
||||||
|
@ -55,6 +55,9 @@ function slideUp (elem) {
|
||||||
* - Has the user opted out of the wayfinding modal?
|
* - Has the user opted out of the wayfinding modal?
|
||||||
*/
|
*/
|
||||||
function shouldOpenWayfinding () {
|
function shouldOpenWayfinding () {
|
||||||
|
// Extract the protocol and hostname of referrer
|
||||||
|
const referrerMatch = document.referrer.match(/^(?:[^\/]*\/){2}[^\/]+/g);
|
||||||
|
const referrerHost = referrerMatch ? referrerMatch[0] : '';
|
||||||
var isExternalReferrer = !referrerWhitelist.includes(referrerHost);
|
var isExternalReferrer = !referrerWhitelist.includes(referrerHost);
|
||||||
var wayfindingOptedOut = getPreference(wayfindingPrefCookie);
|
var wayfindingOptedOut = getPreference(wayfindingPrefCookie);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue