File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
// Store the host value for the current page
2
- currentPageHost = window . location . href . match ( / ^ (?: [ ^ \/ ] * \/ ) { 2 } [ ^ \/ ] + / g) [ 0 ] ;
2
+ const currentPageHost = window . location . href . match ( / ^ (?: [ ^ \/ ] * \/ ) { 2 } [ ^ \/ ] + / g) [ 0 ] ;
3
3
4
4
// Define v3-wayfinding elements
5
5
var wayfindingModal = document . getElementById ( 'v3-wayfinding-modal' ) ;
@@ -55,6 +55,9 @@ function slideUp (elem) {
55
55
* - Has the user opted out of the wayfinding modal?
56
56
*/
57
57
function shouldOpenWayfinding ( ) {
58
+ // Extract the protocol and hostname of referrer
59
+ const referrerMatch = document . referrer . match ( / ^ (?: [ ^ \/ ] * \/ ) { 2 } [ ^ \/ ] + / g) ;
60
+ const referrerHost = referrerMatch ? referrerMatch [ 0 ] : '' ;
58
61
var isExternalReferrer = ! referrerWhitelist . includes ( referrerHost ) ;
59
62
var wayfindingOptedOut = getPreference ( wayfindingPrefCookie ) ;
60
63
You can’t perform that action at this time.
0 commit comments