set checkStorageTask to null in analytics.js - javascript

I am working on a chrome extension and I want to use google analytics to track user data. I am trying to implement analytics.js/Universal Analytics in the same fashion as this tutorial and this tutorial and spent days trying to figure out why it wasn't working for me. Countless articles and online forums have suggested the only modifications I needed to make were setting the checkProtocolTask to null and setting the page when sending a pageview. Running analytics_debug.js, it gives me the error "Cookie write failed. Storage not available, aborting hit." All of the answers to this error online suggest a problem with the cookieDomain, but I tried various different possibilities and nothing worked for me. It was only when I tried setting checkStorageTask to null as well that it finally worked for me. But why did I need to do this, when I haven't found any other evidence of anyone else needing to do this to get analytics to work in an extension?
The checkStorageTask aborts the request if the tracker is configured to use cookies but the user's browser has cookies disabled. After some more research I discovered it is possible for a chrome extension to have it's own cookies, with the domain pointing to the extension ID, as shown in the answer to this question. Is it a problem with my browser individually, then? Or is it a larger problem that I just can't see? Any ideas are greatly appreciated!

Related

Limit on number of cookies allowed? - err_spdy_protocol_error

On Chrome and Firefox I sometimes get the following error err_spdy_protocol_error
once I call the following website https://checkideas.com/.
I have researched on this topic on the internet and on this platform as well. I also found a working solution. Once I delete all the cookies and reload the webpage the error does not emerge.
So if you click on the website for the 1st time it will definitely work. But once there are number of cookies given the website cannot always be called. This is only the pattern I have identified so far. However I would like to have a sustainable solution.
What do I have to do to avoid this issue so that this issue does not occur? What is the source of the error?
Unfortunately following responses on similar questions did not answer my question:
Console errors. Failed to load resource: net::ERR_INSECURE_RESPONSE
What mean ERR_SPDY_PROTOCOL_ERROR in nginx?
I also cannot identify any issue with the certificate.
This error is related to the SPDY Protocol or an antivirus setting.
Updating to a later version of the browser should help fix the error (Google Chrome and Mozilla have dropped support for the SPDY Protocol.
This article contains methods that should help you fix the ERR_SPDY_PROTOCOL_ERROR
on Google Chrome or Mozilla.

Firebase Javascript network error

I have a Firebase app and have started playing around with the quickstart examples. I have created apps in Facebook, Google and Twitter and filled in the necessary clientId/secret information.
When testing the example pages facebook-credentials.html and google-credentials.html, everything works fine.
I am using Firebase 3.6.4 JS also.
When trying out the facebook-popup.html and facebook-redirect.html, and in fact the popup/redirect examples for Google and Twitter, I always get the following error in the Javascript console:
firebase.js:191 Uncaught Error: Network Error
at firebase.js:191
(anonymous) # firebase.js:191
This seems to happen fairly quickly, but the HTTP request is still pending. After maybe 30 seconds, I then get another message in the console:
GET https://XXXXXXX.firebaseapp.com/__/auth/iframe?apiKey=YYYYYYY&appName=%5BDEFAULT%5D&v=3.6.4&usegapi=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_GB.1grkUO4uZ2s.O%2Fm%3D__features__%2Fam%3DAQ%2Frt%3Dj%2Fd%3D1%2Frs%3DAGLTcCMXwBvX3_duAb3Vw22ujByEbXKdJA net::ERR_TIMED_OUT
(note I have masked out my application name as XXXXXXX and API key as YYYYYYY).
Does anyone know why this is happening?
I really want to get Twitter working, but there is no twitter-credentials method, so I'll need to get the popup or redirect working.
It appears that this was a lower level issue on my PC. I haven't gotten to the bottom of it yet but the Twitter examples work on another PC. At this point I am thinking it might be my antivirus or Firewall, so I am closing this topic.
I think you're also being blocked. My application quit working, and another one that was using firebase also quit working, so we called IT. There was new security software blocking the network request. Similar errors, blank popup, that's how I ended up here.

www-embed-player.js:150 GET chrome-extension://eojlgccfgnjlphjnlopmadngcgmmdgpk/cast_sender.js net::ERR_FAILED [duplicate]

I'm having an error running Chromecast sender in Chrome Incognito or if Chromecast extension is not installed:
Failed to load resource: net::ERR_ADDRESS_UNREACHABLE chrome-extension://boadgeojelhgndaghljhdicfkmllpafd/cast_sender.js
Failed to load resource: net::ERR_ADDRESS_UNREACHABLE chrome-extension://dliochdbjfkdbacpmhlcpmleaejidimm/cast_sender.js
Failed to load resource: net::ERR_ADDRESS_UNREACHABLE chrome-extension://hfaagokkkhdbgiakmmlclaapfelnkoah/cast_sender.js
Failed to load resource: net::ERR_ADDRESS_UNREACHABLE chrome-extension://fmfcbgogabcbclcofgocippekhfcmgfj/cast_sender.js
Failed to load resource: net::ERR_ADDRESS_UNREACHABLE chrome-extension://enhhojjnijigcajfphajepfemndkmdlo/cast_sender.js
No cast extension found
Google cast sender is trying to send AJAX requests for local "cast_sender.js". Should this happen or is there a better way to check if Chromecast sender extension exists (not by requesting AJAX request)?
I believe these AJAX requests are a way of asking if Chromecast extension exists. Is there a better way to check if Chromecast extension exists?
Update: After several attempts, it looks like this may have been fixed in latest Chrome builds (per Paul Irish's comment below). That would suggest we will see this fixed in stable Chrome June-July 2016. Let's see ...
This is a known bug with the official Chromecast JavaScript library. Instead of failing silently, it dumps these error messages in all non-Chrome browsers as well as Chrome browsers where the Chromecast extension isn't present.
The Chromecast team have indicated they won't fix this bug.
If you are a developer shipping with this library, you can't do anything about it according to Chromecast team. You can only inform users to ignore the errors. (I believe Chromecast team is not entirely correct as the library could, at the least, avoid requesting the extension scipt if the browser is not Chrome. And I suspect it could be possible to suppress the error even if it is Chrome, but haven't tried anything.)
If you are a user annoyed by these console messages, you can switch to Chrome if not using it already. Within Chrome, either:
Install the Chromecast extension from here.
Configure devtools to hide the error message (see David's answer below).
Update [Nov 13, 2014]: The problem has now been acknowledged by Google. A member of the Chromecast team seems to suggest the issue will be bypassed by a change the team is currently working on.
Update 2 [Feb 17, 2015]: The team claim there's nothing they can do to remove the error logs as it's a standard Chrome network error and they are still working on a long-term fix. Public comments on the bug tracker were closed with that update.
Update 3 [Dec 4, 2015]: This has finally been fixed! In the end, Chrome team simply added some code to block out this specific error. Hopefully some combination of devtools and extensions API will be improved in the future to make it possible to fix this kind of problem without patching the browser. Chrome Canary already has the patch, so it should roll out to all users around mid-January. Additionally, the team has confirmed the issue no longer affects other browsers as the SDK was updated to only activate if it's in Chrome.
Update 4 (April 30): Nope, not yet anyway. Thankfully Google's developer relations team are more aware than certain other stakeholders how badly this has affected developer experience. More whitelist updates have recently been made to clobber these log messages. Current status at top of the post.
If you want to temporarily get rid of these console errors (like I did) you can install the extension here: https://chrome.google.com/webstore/detail/google-cast/boadgeojelhgndaghljhdicfkmllpafd/reviews?hl=en
I left a review asking for a fix. You can also do a bug report via the extension (after you install it) here. Instructions for doing so are here: https://support.google.com/chromecast/answer/3187017?hl=en
I hope Google gets on this. I need my console to show my errors, etc. Not theirs.
How about filtering these errors ?
With the regex filter bellow, we can dismiss cast_sender.js errors :
^((?!cast_sender).)*$
Do not forget to check Regex box.
Another quick solution is to "Hide network messages".
i know it is not the best solution, but the only one supposed solution that i have read for all the web is to install chrome cast extension, so, i've decide, not to put the iframe into the website, i just insert the thumnail of my video from youtube like in this post explain.
and here we have two options:
1) Target the video to the channel and play it there
2) Call the video via ajax, like explain here (i've decided for this one) in a colorbox or any another plugin.
and like this, i prevent the google cast sender error make my site slow
By default Chrome extensions do not run in Incognito mode. You have to explicitly enable the extension to run in Incognito.

Google Chromecast sender error if Chromecast extension is not installed or using incognito

I'm having an error running Chromecast sender in Chrome Incognito or if Chromecast extension is not installed:
Failed to load resource: net::ERR_ADDRESS_UNREACHABLE chrome-extension://boadgeojelhgndaghljhdicfkmllpafd/cast_sender.js
Failed to load resource: net::ERR_ADDRESS_UNREACHABLE chrome-extension://dliochdbjfkdbacpmhlcpmleaejidimm/cast_sender.js
Failed to load resource: net::ERR_ADDRESS_UNREACHABLE chrome-extension://hfaagokkkhdbgiakmmlclaapfelnkoah/cast_sender.js
Failed to load resource: net::ERR_ADDRESS_UNREACHABLE chrome-extension://fmfcbgogabcbclcofgocippekhfcmgfj/cast_sender.js
Failed to load resource: net::ERR_ADDRESS_UNREACHABLE chrome-extension://enhhojjnijigcajfphajepfemndkmdlo/cast_sender.js
No cast extension found
Google cast sender is trying to send AJAX requests for local "cast_sender.js". Should this happen or is there a better way to check if Chromecast sender extension exists (not by requesting AJAX request)?
I believe these AJAX requests are a way of asking if Chromecast extension exists. Is there a better way to check if Chromecast extension exists?
Update: After several attempts, it looks like this may have been fixed in latest Chrome builds (per Paul Irish's comment below). That would suggest we will see this fixed in stable Chrome June-July 2016. Let's see ...
This is a known bug with the official Chromecast JavaScript library. Instead of failing silently, it dumps these error messages in all non-Chrome browsers as well as Chrome browsers where the Chromecast extension isn't present.
The Chromecast team have indicated they won't fix this bug.
If you are a developer shipping with this library, you can't do anything about it according to Chromecast team. You can only inform users to ignore the errors. (I believe Chromecast team is not entirely correct as the library could, at the least, avoid requesting the extension scipt if the browser is not Chrome. And I suspect it could be possible to suppress the error even if it is Chrome, but haven't tried anything.)
If you are a user annoyed by these console messages, you can switch to Chrome if not using it already. Within Chrome, either:
Install the Chromecast extension from here.
Configure devtools to hide the error message (see David's answer below).
Update [Nov 13, 2014]: The problem has now been acknowledged by Google. A member of the Chromecast team seems to suggest the issue will be bypassed by a change the team is currently working on.
Update 2 [Feb 17, 2015]: The team claim there's nothing they can do to remove the error logs as it's a standard Chrome network error and they are still working on a long-term fix. Public comments on the bug tracker were closed with that update.
Update 3 [Dec 4, 2015]: This has finally been fixed! In the end, Chrome team simply added some code to block out this specific error. Hopefully some combination of devtools and extensions API will be improved in the future to make it possible to fix this kind of problem without patching the browser. Chrome Canary already has the patch, so it should roll out to all users around mid-January. Additionally, the team has confirmed the issue no longer affects other browsers as the SDK was updated to only activate if it's in Chrome.
Update 4 (April 30): Nope, not yet anyway. Thankfully Google's developer relations team are more aware than certain other stakeholders how badly this has affected developer experience. More whitelist updates have recently been made to clobber these log messages. Current status at top of the post.
If you want to temporarily get rid of these console errors (like I did) you can install the extension here: https://chrome.google.com/webstore/detail/google-cast/boadgeojelhgndaghljhdicfkmllpafd/reviews?hl=en
I left a review asking for a fix. You can also do a bug report via the extension (after you install it) here. Instructions for doing so are here: https://support.google.com/chromecast/answer/3187017?hl=en
I hope Google gets on this. I need my console to show my errors, etc. Not theirs.
How about filtering these errors ?
With the regex filter bellow, we can dismiss cast_sender.js errors :
^((?!cast_sender).)*$
Do not forget to check Regex box.
Another quick solution is to "Hide network messages".
i know it is not the best solution, but the only one supposed solution that i have read for all the web is to install chrome cast extension, so, i've decide, not to put the iframe into the website, i just insert the thumnail of my video from youtube like in this post explain.
and here we have two options:
1) Target the video to the channel and play it there
2) Call the video via ajax, like explain here (i've decided for this one) in a colorbox or any another plugin.
and like this, i prevent the google cast sender error make my site slow
By default Chrome extensions do not run in Incognito mode. You have to explicitly enable the extension to run in Incognito.

File upload sometimes not working on IE9

I am using valums ajax-upload together with a ashx handler to let users upload files in the webapp Im developing. All is working absolutely fine for about 95% (around 3000) of the users.
For the last about 5% I get reports that the upload never finish, the wheel just keeps spinning people say. It seems that those who get this error are all are using IE9.0.
I have tested on all the IE9.0 I can come across but still have not been able to reproduce the error. I also have tried to log all thinkable errors but still no luck.
Please, can anyone reproduce the problem and hopefully give me a JavaScript console error transcript if any. To test go to step 2 (Upload section) and try to upload a small text file:
https://jobmatchprofile.com/backend/login.aspx?auto_login=24G3FY
UPDATE
I have been in contact with a user who experienced this problem. The error message can be seen here. It is in danish and says: "SCRIPT5 Access denied".
Error message
What is strange is that the user had same IE version as is working for others (me for example): I have been testing on: 9.0.8112.16421 and also ran WIN7 (as I). The Product-id differs however and he had a danish version where I have the US version.
UPDATE II
I was finally able to reproduce this error. I know this sounds a little strange, but belive me it is true: when opening the page via a link sent to my gmail account I get the same error. The user from first Update also used gmail to open the page.
Your reference to Gmail, specifically, points in the direction of a solution: Gmail strips the referrer data from the HTTP headers when you click on a link within an e-mail, except when you use your right mouse button and select "Open in New Tab [or Window]", presumably because this prevents their code from intercepting the headers. Is your script checking for a valid HTTP REFERRER, by any chance?
Are you making any cross-(sub)domain or cross-protocol AJAX calls? If so, then you may have to proxy the request(s). Consider the following solutions from the Yahoo! Developer Network:
http://developer.yahoo.com/javascript/howto-proxy.html
See also:
SCRIPT5: Access is denied in IE9 on xmlhttprequest
Access denied to jQuery script on IE
"Access is denied" JavaScript error when trying to access the document object of a programmatically-created <iframe> (IE-only)
(Un)fortunately, I wasn't able to reproduce the error in IE9, v. 9.0.8112.16421 (although I did get a general on-site error when trying to upload an empty .txt file, but this seems wholly unrelated).
The solution for ie9 is simply to upload using https:
https://www.parse.com/questions/internet-explorer-and-the-javascript-sdk
Even though you are sure that it's related to the user clicking the anchor within the email I would say it's because of policy settings within Internet Explorer. I have seen errors like these before and noticed that the most common errors were related to Internet Explorer policies of users within a corporate environment.

Categories

Resources