Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

addHostnameToWhitelist query


#1

Can I get the benefit of your expertise with the “addHostnameToWhitelist” function.

I have this snippet towards the start of a browser script…

// Get browser capabilities and do nothing with it, so that we start with a then-able command
$browser.getCapabilities().then(function () { 
    $browser.addHostnameToWhitelist(['ssl.google-analytics.com','www.google-analytics.com','analytics.google.com','www-google-analytics.l.google.com', 'bat.bing.com', 'adserver.bing.com', 'ads.bing.com', 'mixpanel.com', 'analytics.twitter.com', 'ad.doubleclick.net']);
    console.log('Analytics Sites added to whitelist, or maybe not');
})

However, the browser log is still throwing a number of the analytics sites out as blocked, e.g.


Can anyone put me out of my misery please ?


#2

Sorted it ! (RTFM again)

slight typo in my function call

This works, changed “addHostnameToWhitelist” to be “addHostnamesToWhitelist”.

// Get browser capabilities and do nothing with it, so that we start with a then-able command
$browser.getCapabilities().then(function () { 
    $browser.addHostnamesToWhitelist(['ssl.google-analytics.com','www.google-analytics.com','analytics.google.com','www-google-analytics.l.google.com', 'bat.bing.com', 'adserver.bing.com', 'ads.bing.com', 'mixpanel.com', 'analytics.twitter.com', 'ad.doubleclick.net']);
    console.log('Analytics Sites added to whitelist, or maybe not');
})

#3

Sweet! Glad you got it sorted @David.Bell - thanks for letting us know.