Open a web page in Google Chrome without activating it Sometimes I want to open a web page in Google Chrome, but without switching to the browser. I have an applescript command (osascript -e 'tell application &quot;Google Chrome&quot;  to open location &quot;URL&quot;') to open a web page, but it activates the browser. Is there a way to open a web page in the browser without activating it?
The script below opens the link with no errors but activates Google Chrome. I'm not sure why is that the case.
tell application &quot;Google Chrome&quot;
    open location &quot;chrome://settings&quot; without activating
end tell
There may have been a time when Google Chrome was compliant with AppleScript commands e.g. run or launch, which would keep it in the background, as it does with e.g. Safari and other applications. Or compliant with with the shell open command using either the -g or -j options along with the -a option.
In testing under macOS Catalina I could not get Google Chrome to consistently open in the background and only with the open command with -jga would it open in the background a few different times, but not at all consistently.
Google clearly is not conforming to the macOS norms!
That said, the only way I could consistently open a URL in Google Chrome in the background was is if it was already running with an open window in the background.
I'll post the example AppleScript code just for you to test if it works for you as it did for me.
set myURL to &quot;https://www.example.com&quot;

if running of application &quot;Google Chrome&quot; then
    tell application &quot;Google Chrome&quot;
        if window 1 exists then
            tell window 1
                make new tab
                repeat while (loading of active tab)
                    delay 0.1
                end repeat
                execute active tab javascript &quot;document.location.href = '&quot; &amp; myURL &amp; &quot;';&quot;
            end tell
        end if
    end tell
end if