0

Is there a way to duplicate a Chrome tab in macOS via keyboard only?

Showing the menu option to do this.

Screenshot of the contextual menu for a Tab inside of Google Chrome with the 'Duplicate' option selected

There are a lot of keyboard shortcuts like Cmd+T, Cmd+Shift+T, is there a way to duplicate a tab from the keyboard?

4
  • Do you mean duplicate an already opened tab?
    – IconDaemon
    Sep 13, 2023 at 21:03
  • There are various questions with answers on how to bind menu entries to keyboard shortcuts on this site. Did you try some of them, what was the result?
    – nohillside
    Sep 18, 2023 at 10:54
  • hi, @nohillside. thanks for your response. i found the way to create custom shortcut for for specific applications, but it does not work with the duplication tab. i do not know why: imgur.com/a/i9Hx872 Sep 20, 2023 at 15:22
  • @IconDaemon exactly Sep 20, 2023 at 15:25

2 Answers 2

1

There are two answers below:

  1. Keyboard shortcut to duplicate Google Chrome tab, keeping URL history and general position on the webpage, in macOS. This uses Automator running an AppleScript.

  2. Old answer: Simple keyboard shortcut Cmd+L and Opt+Return, but doesn't keep URL history nor general position on the webpage. This shortcut is mentioned somewhere in Is there a shortcut key to duplicate a tab in Google Chrome?.

1. Keyboard shortcut to duplicate Chrome tab, keeping URL history

To duplicate a Chrome tab while retaining URL history, you can run the following AppleScript using Automator, and assign this task to a keyboard shortcut in System Settings:

  1. Open Automator and choose Quick Action.

  2. Search for and drag Run AppleScript from the left side to the main workflow window.

  3. Copy and paste the following into the Run AppleScript box:

on run {input, parameters}
    
    if application "Google Chrome" is running then
        tell application "Google Chrome"
            activate
        end tell
        tell application "System Events"
            click menu item "Duplicate Tab" of menu 1 of menu bar item "Tab" of menu bar 1 of application process "Chrome"
        end tell
    end if
    
    return
end run
  1. Set the "Workflow receives" to "no input". It should look like this now:

AppleScript script in Automator to duplicate Chrome tab

  1. Save the script (Cmd+S) and enter the name "Duplicate Chrome tab". The script will be saved in the default directory ~/Library/Services/.

  2. You've created the script with Automator and saved it, now you need to install it to make it visible to System Settings. Go to ~/Library/Services/ and open the script up again, this time it uses the default app "Automator Installer", now press Cmd + S once more to save and now install it. This makes the service visible in System Settings.

  3. Open System Settings > Keyboard > Keyboard Shortcuts... > Services > General, and tick the checkmark next to Duplicate Chrome tab, and assign a keyboard shortcut like Ctrl+T.

  4. Open Google Chrome to a tab with some URL history, then press your keyboard shortcut. If you get a pop-up window saying you need permissions, make sure you allow it inside System Settings.

  5. Voila, you now have a keyboard shortcut to duplicate a Chrome tab with URL history, and this also remembers your general placement within the webpage.

2. Keyboard shortcut to duplicate Chrome tab, without URL history

This was my old answer, but it doesn't retain URL history nor does it remember your placement within a webpage:

Press Cmd+L to select the current URL, then Opt+Return to duplicate the current tab.

Is there a shortcut key to duplicate a tab in Google Chrome?

4
  • Hi @Aeronautix, thanks for your response. This is good enough to copy the URL and create a new tab, but it does not 'duplicate' it. 'Duplicate' means, for example, that in the new tab, I can go 'Back' to the previous URL in the history. Oct 6, 2023 at 10:46
  • Hi, I tried duplicating the tab using AppleScript + Google Chrome, where I told AppleScript to use the menu bar of Google Chrome: --> Tab --> Duplicate Tab, but this did not work to retain URL history for some reason. I might look into using a "mouse clicker" program to click on "Tab" then on "Duplicate Tab", but I have limited knowledge with such programs right now, but I will report back if I find anything.
    – Aeronautix
    Oct 6, 2023 at 20:59
  • I got AppleScript to work, answer has been updated.
    – Aeronautix
    Oct 7, 2023 at 1:18
  • amazing! good work! Accepted! @Aeronautix Oct 9, 2023 at 12:34
0

I do not really like this solutions, but it works from the keyboard only:

  1. In chrome create a bookmark (right click in the bookmark bar -> 'Add Page').

  2. Edit the url to be:

    javascript:(function(){ var url = window.location.href; window.open(url, '_blank');})();

  3. Edit the name to be "Duplicate Tab"

  4. Save

If you want to duplicate the current tab, type cmd + L (edit current url) and type "Duplicate Tab" and enter. if you have a tool to run a script from a keyboard shortcut (like Raycast) it will be even faster

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .