TIL: Blocking the Google login popup with uBlock Origin

Who hasn't been interrupted by that Google popup asking you to sign in or choose an account when visiting sites like YouTube, Google Search, Gmail, etc?

This popup shows up on practically every Google service and is especially annoying when you prefer to browse without being logged in or simply want to close the tab without being bothered.

In my case the problem is even worse: I use Vimium to navigate websites with the same navigation keys as vim, and the popup grabs the keyboard focus, blocking all of Vimium's keys. In other words, besides being annoying, it completely breaks my browsing flow.

Solution with uBlock Origin

uBlock Origin lets you create custom filters to block specific elements of web pages.

Step by step

  1. Open the uBlock Origin panel by clicking the extension icon
  2. Click the gear icon to open the Dashboard
  3. Go to the My filters tab
  4. Add the following line:
||accounts.google.com/gsi/$frame,third-party
  1. Click Apply changes

What does this filter do?

The Google login popup is loaded through an iframe that comes from accounts.google.com/gsi/ (GSI = Google Sign-In). The filter blocks any frame loaded from this address when it is requested by a third-party site (third-party).

Alternative: more aggressive filter

If you also want to block the popup that shows up on Google's own sites (YouTube, Google Search, etc):

||accounts.google.com/gsi/$frame

By removing third-party, the filter applies to all sites, including Google's.