Fixed a problem where uBlock Origin was blocking Google’s third-party authentication pop-up window

Written by wantaek.lim | Published 2017/04/21
Tech Story Tags: when-blocked-by-ublock | google-analytics | when-oauth-popup-blocked | chrome-ublock-origin | firefox-ublock-origin

TLDRvia the TL;DR App

You have to sign up and sign in to Granary.pro with a Google account.

The problem was that the popup window requesting access to your Google account was blocked by uBlock Origin when you clicked the “Sign up free with Google” button.

In Granary.pro, we used the following declaration in homepage source to use GA, and this part was blocked by uBlock Origin.

<script src=”/assets/js/google-analytics.js”></script>

Since google-analytics.js is just a wrapping of the declaration needed to use GA to read the source clearly,

(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,’script’,’https://www.google-analytics.com/analytics.js','ga');

ga(‘create’, ‘UA-91234420–1’, ‘auto’);

If the above declaration is directly declared in homepage source, it will be fixed the problem that Google’s third party authentication pop-up window is blocked by uBlock Origin.

Hacker Noon is how hackers start their afternoons. We’re a part of the @AMIfamily. We are now accepting submissions and happy to discuss advertising & sponsorship opportunities.

To learn more, read our about page, like/message us on Facebook, or simply, tweet/DM @HackerNoon.

If you enjoyed this story, we recommend reading our latest tech stories and trending tech stories. Until next time, don’t take the realities of the world for granted!


Published by HackerNoon on 2017/04/21