I've run into a weird problem with Chrome and Facebook Pixel and I'm wondering if others have run into the same thing.
In Chrome, and only in Chrome, javascript confirmation dialogs suddenly went haywire on our site recently. The issue is that the dialog will pop up just fine, but then be immediately dismissed without user input. It just pops up and then instantly goes away. This is a big problem, because if you can't click OK on the confirmation dialog then whatever you were trying to do won't happen.
To clarify, this has nothing to do with Chrome's fixes for javascript dialog abuse like dismissing the dialog if you change tabs. The behavior I'm talking about is obviously not working as intended, as the dialog should either show and allow interaction or not show at all.
What I have found is that this problem goes away if I comment out the code for Facebook Pixel from the masterpage. It seems as if whatever event tracking Pixel is doing is interfering with javascript dialogs, but only in Chrome. Other browsers are fine.
Sample code is below, if others who use Facebook Pixel can replicate this that would be good to know, I'm searching for a workaround but so far the best I've come up with is to replace the Pixel javascript code with their IMG option.
Facebook Pixel code:
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window,document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '<YOURID>');
fbq('track', 'PageView');
</script>
<noscript>
<img height="1" width="1"
src="https://www.facebook.com/tr?id=<YOURID>&ev=PageView
&noscript=1"/>
</noscript>
Button for launching dialog:
<asp:Button runat="server" ID="TestButton" OnClientClick="return confirm('Are you sure that you want to do this?');" Text="Confirm" />
What I have tried:
I found that removing Facebook Pixel javascript resolves the problem. Just commenting out the fbq('track', 'PageView') line does the trick. But of course, I need Facebook Pixel to keep working or I'll get a talking to.