How to block the annoying “Before you continue” popup on Google?

Solution 1:

Add the following JavaScript to your browser through an extension (like Tampermonkey for Chrome, or Firefox):

// ==UserScript==
// @name         avoid Google's "before you continue"
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  How to block the annoying “Before you continue” popup on Google?
// @author       jonas
// @url          https://stackoverflow.com/a/63999294/1153476
// @match        https://www.google.com/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

// This will remove the popup but there are some problems:
// Buttons and menus like 'More', 'Tools', and many others will not work
const style = document.createElement('style');
style.innerHTML = /* css */ `
  div[aria-modal] {
    display: none !important;
  }
`;
document.head.append(style);

// This solves the previous problems but it's probably not that great for privacy
const consentMatch = document.cookie.match(/CONSENT=(PENDING|YES)\+(\d+)/);
document.cookie=`CONSENT=YES+${consentMatch ? consentMatch[2] : '0'}; domain=.google.com`;

In Tampermonkey, on script Settings page, set Run at to document-start.

Solution 2:

Just block all of the cookies for the page where you see this popup and voilà.

Open the View site information pane

Block all of the cookies that you see there