All posts 14 Nov 2026 8 min

How to use Gemini as a search engine in Chrome, Edge and Chromium address bar

You type gg, press Tab, write your question in the address bar, hit Enter and Gemini opens with your prompt already sent. That’s what this post sets up. It works in Chrome, Edge, Chromium, Brave and Vivaldi, and it takes about 5 minutes.

I’ve recently started using Gemini and I was surprised that I could not simply add gemini.google.com as a search engine in my browser. With ChatGPT or Perplexity it’s a one-liner. With Gemini you put ?q= in the URL, Gemini opens… and ignores it. Empty chat. So I fixed it with a short userscript.

Sounds familiar?

If you ended up here, you have probably asked (or googled) one of these:

  • How do I add Gemini as a search engine in Chrome?
  • Can I set Gemini as the default search engine in Microsoft Edge?
  • Is there a Gemini URL parameter to pass a prompt, like chatgpt.com/?q=?
  • Why does gemini.google.com/app?q=hello open an empty chat?
  • How do I search Gemini directly from the address bar (omnibox)?
  • Chrome has @gemini, why can’t I have the same in Edge / Brave / Vivaldi?

Short answers: Gemini has no public URL parameter for prompts, so a custom search engine alone is not enough. You need a tiny bit of JavaScript running on the Gemini page that reads the prompt from the URL, types it into the chat box and presses send. Read on.

Quick solution summary

If you just want the steps:

  1. Install a userscript manager: Violentmonkey (or Tampermonkey).
  2. Add this userscript to it.
  3. In your browser, add a site search with the URL https://gemini.google.com/app?prompt=%s and the shortcut gg.
  4. Type gg → Tab → your prompt → Enter.

💡 Key insight
The browser already knows how to put your query into a URL (that’s the %s). The missing piece is on Gemini’s side: something has to read it back from the URL and press Send.

Why doesn’t it work out of the box?

Every Chromium-based browser lets you add a “site search”: a URL template with %s in place of the query. When you type the shortcut and press Tab, whatever you type next goes into %s. That’s how https://www.google.com/search?q=%s works, and that’s how https://chatgpt.com/?q=%s or https://www.perplexity.ai/search?q=%s work, because these sites read the query from the URL.

Gemini doesn’t. It’s a single-page app. When it loads, its router takes over the URL and nothing reads the query string, so the prompt is dropped and you get an empty chat. There’s no ?q=, no ?prompt=, nothing documented.

What about Chrome’s built-in @gemini shortcut? It exists, but it lives only in desktop Google Chrome, you can’t rename it or edit it, and it’s not there in Edge, Brave, Vivaldi or plain Chromium. I wanted the same gg shortcut everywhere.

Step 1: install a userscript manager

A userscript manager is a browser extension that runs small JavaScript snippets on the websites you choose. I use Violentmonkey: it’s open source and the script below doesn’t need any special permissions (@grant none).

  • Edge: install Violentmonkey from Edge Add-ons (the official site links to every store).
  • Chrome: Chrome has dropped Manifest V2 extensions, so pick the Manifest V3 build of Violentmonkey (currently in beta) or use Tampermonkey. The script works the same in both.
  • Firefox: Violentmonkey works too, see the FAQ at the end.

⚠️ Chrome 138+
Userscript managers now need an extra switch. Go to chrome://extensions, click Details under your userscript manager and turn on Allow User Scripts. Without it the extension is installed but no script runs.

Step 2: add the userscript

Open the Violentmonkey dashboard, click + → New, replace the template with the code below and hit Save. The same script is in my public gist.

javascript
// ==UserScript==
// @name         Gemini URL Prompt & Auto-Submit
// @namespace    local.gemini.prompt
// @version      1.0
// @description  Reads ?prompt= or ?q= from URL, fills Gemini textbox, and submits
// @match        https://gemini.google.com/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // 1. Capture the parameter immediately before Gemini's router strips it
    const url = new URL(window.location.href);
    const promptText = url.searchParams.get('prompt') || url.searchParams.get('q');
    if (!promptText) return;

    // Clean the URL in the address bar so refreshing the page won't re-send the prompt
    url.searchParams.delete('prompt');
    url.searchParams.delete('q');
    window.history.replaceState({}, document.title, url.pathname + url.search);

    // 2. Poll for the editor to load (gives up after 15 seconds)
    let attempts = 0;
    const interval = setInterval(() => {
        attempts++;
        const editor = document.querySelector('.ql-editor[contenteditable="true"], div[contenteditable="true"][role="textbox"]');

        if (editor) {
            clearInterval(interval);
            editor.focus();

            // Insert text using execCommand so Angular's state detects the input
            document.execCommand('insertText', false, promptText);
            editor.dispatchEvent(new Event('input', { bubbles: true }));

            // 3. Wait briefly for the Send button to activate, then submit
            setTimeout(() => {
                const sendBtn = document.querySelector(
                    'button.send-button, button[aria-label*="Send"], button[aria-label*="Wyślij"]'
                );
                if (sendBtn && !sendBtn.disabled) {
                    sendBtn.click();
                } else {
                    // Fallback: simulate pressing Enter
                    editor.dispatchEvent(new KeyboardEvent('keydown', {
                        key: 'Enter', code: 'Enter', keyCode: 13, which: 13, bubbles: true
                    }));
                }
            }, 300);
        } else if (attempts > 150) {
            clearInterval(interval);
        }
    }, 100);
})();

How the script works

It’s ~50 lines, but a few lines in there are not obvious:

  1. @run-at document-start - the script runs before Gemini’s own JavaScript. This is the important one: if it ran later, the router would already have rewritten the URL and the prompt would be gone.
  2. It reads ?prompt= or ?q= - the browser URL-encodes your query when it fills in %s, and searchParams.get() decodes it back, so spaces, &, ? and non-English characters all survive.
  3. history.replaceState removes the parameter from the address bar, so refreshing the page or restoring the tab later doesn’t send the same prompt again.
  4. It polls for the chat box every 100 ms, for up to 15 seconds. Gemini renders the editor some time after the page loads, so there’s nothing to grab at document-start.
  5. document.execCommand('insertText') instead of setting innerText. The chat box is a contenteditable element managed by Angular, and Angular only notices text that arrives the way typed text does. Set innerText directly and the text shows up, but the Send button stays disabled. Yes, execCommand is deprecated. It’s also the most reliable way to fake typing into a rich-text editor.
  6. It clicks Send, found by its CSS class or its aria-label. If it can’t find an enabled button, it falls back to pressing Enter in the editor.

Step 3: add Gemini as a site search in your browser

Google Chrome / Chromium / Brave

  1. Go to chrome://settings/searchEngines (Settings → Search engine → Manage search engines and site search).
  2. Next to Site search, click Add.
  3. Fill in:
    • Name: Gemini
    • Shortcut: gg
    • URL with %s in place of query: https://gemini.google.com/app?prompt=%s
  4. Click Add.

Microsoft Edge

  1. Go to edge://settings/searchEngines (Settings → Privacy, search, and services → Address bar and search → Manage search engines).
  2. Click Add.
  3. Fill in:
    • Search engine: Gemini
    • Shortcut: gg
    • URL with %s in place of query: https://gemini.google.com/app?prompt=%s
  4. Click Add.

You can pick any shortcut you like. I went with gg because it’s quick to type and doesn’t collide with any real word I’d type at the start of the address bar.

🤔 Can I make Gemini my default search engine?
Yes: click ⋮ next to the entry and choose Make default. Every query typed in the address bar then goes to Gemini. I don’t, because I still want plain Google for “weather tomorrow”, but it works.

Use it

Type gg in the address bar, press Tab (Chrome also accepts Space), and the address bar switches to Search Gemini. Write your prompt, hit Enter.

Gemini opens, the prompt appears in the chat box, and about a second later it’s sent and the answer starts streaming. The address bar shows a clean https://gemini.google.com/app.

Troubleshooting

Gemini opens, but the chat box stays empty

The script didn’t run. Check that:

  • the script is enabled in the Violentmonkey dashboard,
  • on Chrome 138+, Allow User Scripts is turned on for the extension (see step 1),
  • the URL in your site search starts with exactly https://gemini.google.com/ so @match covers it.

Open Gemini and click the Violentmonkey icon: the script should be listed as active on that page.

The prompt is typed in, but not sent

The script can’t find the Send button. It matches the English label Send and the Polish Wyślij, because I use Gemini in Polish 🇵🇱. If your Gemini is in another language, add your translation to the selector, e.g. for German:

javascript
'button.send-button, button[aria-label*="Send"], button[aria-label*="Senden"]'

To find the label, right-click the Send button → Inspect and look for aria-label. The same goes for the editor selector: if Google redesigns the page, this is the line to update.

I have more than one Google account

Gemini puts the account index in the path. To open the prompt in your second account, use:

text
https://gemini.google.com/u/1/app?prompt=%s

You can also add two site searches, e.g. gg for personal and gw for work.

Refreshing the page sends the prompt again

It shouldn’t. That’s what replaceState is for. If it does, something re-added the parameter to the URL. Check that you don’t have two copies of the script enabled.

A word of caution

The script sends any ?prompt= it finds, no matter where the link came from. Someone could send you a link like https://gemini.google.com/app?prompt=... and opening it would send that prompt from your account. It’s low risk, since they can’t read the answer, but if it bothers you, rename the parameter in both the script and the site search to something only you use, e.g. ?gg_prompt_7f3a=%s.

FAQ

Does Gemini have an official URL parameter for prompts?
No. That’s why this setup needs the userscript. ChatGPT (https://chatgpt.com/?q=%s) and Perplexity (https://www.perplexity.ai/search?q=%s) support it natively, so for those a plain site search is enough.

Does it work in Firefox?
The userscript does: Violentmonkey is available for Firefox. For the shortcut, the simplest way is a bookmark: set its URL to https://gemini.google.com/app?prompt=%s and its Keyword to gg. Then gg your prompt in the address bar does the same thing.

Does it work on mobile?
Not in the regular Chrome app on Android or iOS, because it doesn’t support extensions. This is a desktop trick.

That’s all

gg [TAB] and off you go. Happy prompting! 🚀

Tags

Comments

Read next

2026·01

How to connect to Home Assistant from anywhere using NordVPN meshnet

6 min
2024·10

Kubernetes: podAffinity with NotIn vs podAntiAffinity with In

6 min
2023·05

Twitter Sentiment Analysis on BigQuery using ONNX + Huggingface Transformers

11 min