Skip to content

avoid new relic in IE10#9260

Merged
Bjvanminnen merged 1 commit into
stagingfrom
ie10NewRelic
Jun 30, 2016
Merged

avoid new relic in IE10#9260
Bjvanminnen merged 1 commit into
stagingfrom
ie10NewRelic

Conversation

@Bjvanminnen

Copy link
Copy Markdown
Contributor

dc3b253

In the above commit, Phil made it so that the new relic script wouldn't even be included in IE <= 9 using conditional comments. Unfortunately, those don't work on IE10+. My solution here is to add some additional scripting that blows away the new relic object.

Unfortunately, I haven't been able to figure out how to test on localhost, where new relic is never included. Let me know if you have any ideas on how I might do this.

@Bjvanminnen

Copy link
Copy Markdown
Contributor Author

@davidsbailey @wjordan As reviewers of Phil's PR, could you take a look at this. Any idea how I could test on my localhost?

@davidsbailey

Copy link
Copy Markdown
Member

@Bjvanminnen My general strategy for testing prod-only newrelic changes has been to test on production-console. If you need to be logged in to test your changes, then an added step of pointing a load balancer at it may be needed.

result = "<!--[if !IE]><!--> " +
"#{script_tag} " +
"<script>if (navigator.userAgent.match('MSIE 10.0;')) { delete window.NREUM; }</script>" +
"<!--<![endif]-->"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is window.NREUM coming from -- did you find the source code containing it somewhere, or did you have to inspect what was rendered by script_tag ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I inspected what was rendered. I do worry a little that this could change underneath us.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable. worst case, we start seeing new relic errors in IE10 again, right?

@davidsbailey

Copy link
Copy Markdown
Member

LGTM

@Bjvanminnen

Copy link
Copy Markdown
Contributor Author

Semi-tested on production-console by making sure that (a) my additional code appeared (b) it didn't have syntax errors and (c) window.NREUM was still defined in Chrome.

Did not test that IE10 successfully disables newrelic, because to use code-studio on production-console, I need to use a virtual host and don't know how to do that on IE10.

I don't love merging this without more thorough testing, but I'm inclined to merge and keep a close eye on the next DTP.

@davidsbailey

Copy link
Copy Markdown
Member

SGTM
On Jun 30, 2016 4:43 PM, "Brent Van Minnen" notifications@github.com
wrote:

Semi-tested on production-console by making sure that (a) my additional
code appeared (b) it didn't have syntax errors and (c) window.NREUM was
still defined in Chrome.

Did not test that IE10 successfully disables newrelic, because to use
code-studio on production-console, I need to use a virtual host and don't
know how to do that on IE10.

I don't love merging this without more thorough testing, but I'm inclined
to merge and keep a close eye on the next DTP.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#9260 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AHoY5c4VUDK5tMxnQe3NyzGXbqwOtjyFks5qRFSfgaJpZM4JBszG
.

@Bjvanminnen

Copy link
Copy Markdown
Contributor Author

@breville as dotd tomorrow, can you ping me when we DTP so i can validate? thanks

@Bjvanminnen Bjvanminnen merged commit 6d2b304 into staging Jun 30, 2016
@Bjvanminnen Bjvanminnen deleted the ie10NewRelic branch June 30, 2016 23:58
@Bjvanminnen

Copy link
Copy Markdown
Contributor Author

This results in the following error on IE10:
image

Apparently NREUM doesn't exist here (window.newrelic does). Given that I apparently don't understand this as well as I'd like, and this fix didn't work, I'm going to just revert this PR. I don't think there's any need to hot fix this revert as there's no clear user bad.

@davidsbailey

Copy link
Copy Markdown
Member

changing this PR to delete window.newrelic, and then testing it on
production-console with IE10, seems like a good next step. It seems like
you could create a new load balancer pointed at produciton-console's
dashboard, and then point IE10 in saucelabs at that load balancer's public
IP. I don't know what a virtual host is in this context, but I'd be
interested to hear what it is and how you were thinking of using it to test
IE10 against production-console if you haven't already solved the problem
another way.

On Fri, Jul 1, 2016 at 2:11 PM, Brent Van Minnen notifications@github.com
wrote:

This results in the following error on IE10:
[image: image]
https://cloud.githubusercontent.com/assets/1767466/16534509/106e3206-3f95-11e6-8538-e11799f8f11f.png

Apparently NREUM doesn't exist here (window.newrelic does). Given that I
apparently don't understand this as well as I'd like, and this fix didn't
work, I'm going to just revert this PR. I don't think there's any need to
hot fix this revert as there's no clear user bad.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#9260 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AHoY5SSdUbmWMpy89XTUBPqqeKduT2Fpks5qRYJ1gaJpZM4JBszG
.

@Bjvanminnen

Copy link
Copy Markdown
Contributor Author

One can apparently only hit code-studio on production-console by setting a particular header (Host: studio.code.org). I got around this on chrome by using https://chrome.google.com/webstore/detail/virtual-hosts/aiehidpclglccialeifedhajckcpedom?hl=en but don't have a way to do that on IE.

@davidsbailey

Copy link
Copy Markdown
Member

perhaps you can get around this by naming the load balancer public url something like production-console-studio.code.org? AFAIK you only need the "Host" header so that cookies will be on code.org.

@Bjvanminnen

Copy link
Copy Markdown
Contributor Author

I was using the public DNS for production-console (which I think means I'm skipping the load balancer?). When doing this, it takes me to the code.org site, unless I add the Host header (at which point I go to code-studio).

@davidsbailey

Copy link
Copy Markdown
Member

correct, using the public DNS for production-console means skipping the
load balancer.

On Tue, Jul 5, 2016 at 11:30 AM, Brent Van Minnen notifications@github.com
wrote:

I was using the public DNS for production-console (which I think means I'm
skipping the load balancer?). When doing this, it takes me to the code.org
site, unless I add the Host header (at which point I go to code-studio).


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#9260 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AHoY5UZMwm4_ZfFnBCRr_srmPV_wkx29ks5qSqK_gaJpZM4JBszG
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants