New Relic browser agent script is not downloading on Chrome and Edge

Hello,
I am trying to add custom actions for our browser application and implemented addPageAction method for required calls. Everything worked well on Localhost and I am able to query the custom actions. But When I deployed the changes to our UAT environment, I am unable to see https://bam-call.nr-data.net and https://js-agent.newrelic.com scripts on browsers (google chrome & Edge). However IE version 1809 is working well and capturing custom actions.

Hi, @mpullagurla: Do you your Chrome and Edge browsers have any ad blockers or other extensions installed? If so, try disabling them. Sometimes extensions block the download of the Browser agent.

2 Likes

I don’t have any extensions on Chrome browser and also ad blockers is disabled. But still the additional scripts are not downloading from CDN server on the browser, hence unable to collect the data to NewRelic board

@mpullagurla Thanks for the followup here! To clarify the issue, it sounds like everything is working well using localhost, however after deploying your application to production, the browser’s loader script is fine but the full script from our CDN is not making it into your app, is that correct? Or, do you see it in your application but only on IE browser and not Chrome or Edge?

Are you getting any error messages in Chrome/Edge?

Is your application publicly-accessible? If yes, can you please provide the page URL?

Is there something in the production app architecture that is blocking the script from being fully accessible from loading from our CDN?

Thank you again,

@cfrankenfield in IE browser , I can see browser agent script and also the downloaded js-agent.newrelic.com( ) and
bam-cell.nr-data.net scripts( ) ,
but something is stopping to download these two scripts in chrome and edge. so, I am unable to capture data to new relic.

yes, our application is public - Express Scripts Canada Pharmacy - Index

I am guessing the F5/firewall is stoppoing to download these scripts.

@mpullagurla Thanks for the additional information! I visited your site in Chrome, Firefox and Safari and not seeing that the browser agent is making it into the application. If you run the command newrelic.info in your developer console, you should see metadata returned. If you see an undefined message, it’s not been installed properly.

I’m including this link to a detailed installation troubleshooting guide that may help.

You may be on the right track for how the firewall may be interfering in getting the agent into the application in production vs. local environment. Keep us posted on what else you find. Thanks!

@cfrankenfield I am still working on lower environment. We didn’t push new relic to production yet. I can see metadata when I run newrelic.info on dev environment, but it is not downloading bam-cell.net-data and js-agent scripts.
However it is able to download those scripts on my localhost and able to capture the data. I can see the localhost traffic on newrelic dashboard.

New relic dashboard: https://one.nr/0BoQDzm55Ry

@cfrankenfield Followed this document: CSP v2: Host and install the Browser agent | New Relic Documentation to host in our application.
1 - Its working fine and able to download additional scripts (js-agent and bam-cell.nr-data.net), but only on localhost. However, when I deployed to our lower environments, its not working-unable to download additional scripts and giving Content-Security-Policy errors)
2 -Added CSP header in meta tag of index.html (Content-Security-Policy: default-src ‘self’ https://js-agent.newrelic.com https://bam.nr-data.net). With this, even localhost is able to download js-agent script but not downloading bam-cell.nr-data script.

Would like to understand on why bam-cell.nr-data script is not downloading , however js-agent script is downloaded

@mpullagurla Were you able to check whether the firewall was affecting this?

To confirm, are you self hosting the browser agent’s JavaScript as a .js file now? If yes and it’s still being blocked, that would be likely within your application environment (as it wouldn’t rely on the CDN).

Have you whitelisted and then added both of the New Relic Browser domains to your CSP whitelist (as mentioned here)?

@cfrankenfield Yes, we are self hosting the browser agent and also whitelisted the mentioned domains. Its working fine now and I am able to capture the data on NewRelic Dashboard.

Thanks for your help, really appreciate it! :smile:

Great to hear you got that sorted @mpullagurla! Let us know if you need anything else!

@nmcnamara @cfrankenfield Hi , I am unable to load my browser application on Non-prod environment.
application name: esc-web-pharmacymanager
URL: https://one.newrelic.com/-/037jbe0GnRy

Please see the attachment. Please let me know what might be causing this?

@mpullagurla I was able to load that link provided just now. Are you still having an issue? If yes, is there an error message in the developer console of the browser window? Thank you again.

@cfrankenfield Still I am unable to load the page, getting following error in the console.

Refused to display ‘https://frame-rpm.newrelic.com/’ in a frame because it set ‘X-Frame-Options’ to ‘deny’.

@cfrankenfield This is the error message I am seeing today…

@mpullagurla To clarify, are you still seeing this error or did that go away – Refused to display ‘https://frame-rpm.newrelic.com/’ in a frame because it set ‘X-Frame-Options’ to ‘deny’.

Is the new error from today the first one from the console? (err_connection_reset) If yes, can you please click on / open up the stack trace so we can see more info? If you are able to find which code file this error is pointing to and “pretty print” and take a snapshot of what in the code is highlighted as causing the error, that is helpful for troubleshooting.

Also, are others on the account having access issues or is it isolated to a specific browser / user?

After we hear back from you, next steps may be opening up a support ticket on your behalf so we can more easily transmit troubleshooting files (as I may want to collect a video or HAR file of what you are seeing).

Thanks again,

@cfrankenfield Yes I am still seeing this error - – Refused to display ‘https://frame-rpm.newrelic.com/’ in a frame because it set ‘X-Frame-Options’ to ‘deny’.

Now I am seeing only this error on the console. I am not getting the errors I shared on the screenshot.

My collegue can open the url , the issue is only with my machine/browser

@mpullagurla Thanks for the quick response! Do you happen to have any browser extensions running in Chrome? Any ad blockers or Ghostery? Those are sometimes known to cause issues.

Do you still see the error if using Safari or Firefox? Thanks again,

@cfrankenfield I dont have any browser extensions and adblockers. It used to load well before 2 weeks in the same browsers.
I don’t have safari, but my collegue is able to load the browser application in Safari.

I am still getting the same error on Chrome, Edge, IE -
Refused to display ‘https://frame-rpm.newrelic.com/’ in a frame because it set ‘X-Frame-Options’ to ‘deny’.

In Firefix I got this error - To protect your security, frame-rpm.newrelic.com will not allow Firefox to display the page if another site has embedded it. To see this page, you need to open it in a new window.
But on the console getting same error [The loading of “Redirecting... in a frame is denied by “X-Frame-Options“ directive set to “deny“.] When I open in new window, I am able to see graphs.

@mpullagurla Thank you for the additional information. I’m going to create a ticket so we can investigate this error further. Please look out for communication from Support. Thanks again,