Skip to content

About

Open a URL in an existing Chrome or Safari tab, or create a new tab if not existing.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Important

✨ This is the CLI version.
👉 The Chrome extension is here: lennarto/reopen-existing-tab-extension

Fallback image description

Simple CLI to (re)open a specific URL. If no such tab exists, it opens a new one.

Demo GIF

🚀 Installation

brew tap lennarto/reopen
brew install reopen

🔥 Usage

reopen netflix.com # standard-browser = chrome
reopen safari netflix.com # use specific browser
reopen standard safari # change standard-browser
Use RAW script without homebrew (no installation required)
osascript -l JavaScript /scripts/open-chrome-tab.js "https://web.whatsapp.com/"

Browsers

✅ Supported

reopen standard chrome
reopen standard safari 
reopen standard edge 
reopen standard opera 

❌ NOT Supported

Unfortunately, Arc and Firefox do not allow access to "tabs". They also have very limited AppleScript support. A solution for Firefox might be possible, but needs more development effort. You can upvote the issues to show your interest.

Arc support Firefox support

🧩 Integration Examples

You can integrate this with Tools like Apple Shortcuts or BetterTouchTool to quickly re-open urls with specific gestures, buttons, or keyboard shortcuts.

‼️ You might need to load your shell config first

BetterTouchTools and Shortcuts (especially in “Run Shell Script”) often run a minimal environment: they don’t load your full shell config. That’s why reopen might be unknown inside these tools, and you might have to load your shell config before. In my case, it works with:

source ~/.zshrc
reopen "https://netflix.com"

‼️ How to Format URLs Correctly in embedded terminals

In the embedded terminals, you might need to put the url in "brackets" and add https://

reopen netflix.com # works perfectly in normal terminals
reopen "https://netflix.com" # might be needed in embedded terminals (like Shortcuts or BetterTouchtools)

Better Touch Tools

Example using BetterTouchTool

Apple Shortcuts

Example using BetterTouchTool

💙 Support

🐞 Found a bug? Missing a specific feature?

Feel free to file a new Issue.

🤝 Contact me

I love building digital products, working in it-strategy, or applying ai in real-world use cases. On top of that, i create private it expert reports (🇩🇪 IT-Gutachten) for legal proceedings in germany, especially in criminal cases. 👉 My website 👈

🍻 Buy me a beer

If you’ve found something useful, feel free to fuel my next project with a Beer! 🍻 I do have a couple of cool ideas in my backlog 🚀 👉 My Paypal | Ko-Fi 👈

About

Open a URL in an existing Chrome or Safari tab, or create a new tab if not existing.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages