Ian Mulvany

April 19, 2023

I have just built my first Safari Extension!

I often have a desire to copy a bunch of URLS from my current safari window, for example if I am opening tabs while at a meeting, to look at the resources that are being mentioned. I might want to capture them later in some notes. 

I was wondering whether there might be a way to easily grab all links that I have open in my tabs, but instead of searching for this on google I decided to ask ChatGPT. This is what it said: 

  1. Open Safari on your Mac.
  2. Click on the "Window" menu in the menu bar at the top of the screen.
  3. Select "Show All Tabs" from the drop-down menu. This will display a grid of all the tabs that are currently open in Safari.
  4. Click and hold the "Command" key on your keyboard.
  5. Click on each tab that you want to include in your list. Each selected tab will be highlighted with a blue outline.
  6. Release the "Command" key when you have selected all the tabs that you want to include.
  7. Right-click (or Control-click) on any of the selected tabs.
  8. Select "Add Bookmarks for These X Tabs" from the contextual menu (where "X" is the number of tabs you selected).
  9. In the pop-up window that appears, select a location to save the bookmarks (such as the Bookmarks Bar or a folder in your bookmarks).
  10. Give the bookmarks a name, such as "Open Tabs List," and click "Add."
  11. Open the Bookmarks menu in the menu bar at the top of the screen.
  12. Select the location where you saved the bookmarks (such as the Bookmarks Bar or a folder in your bookmarks).
  13. Right-click (or Control-click) on the bookmarks you just created.
  14. Select "Export Bookmarks" from the contextual menu.
  15. Choose a location to save the exported bookmarks file (such as your Desktop).
  16. Open the exported bookmarks file in a text editor, such as TextEdit or Microsoft Word.
  17. You will see a list of all the tabs that were open in Safari, along with their titles and URLs. You can edit or format this list as needed, and then save it as a text document.

Phew, that's a lot of steps. So I wondered, could I do this by building an extension to Safari? After about 40 minutes of back and forth with ChatGPT I'd built my first ever extension to Safari (having never used XCode or Swift, or built anything in this ecosystem before)!

It helped me with understanding how to configure Xcode, how to configure Safari, and to allow unsigned extensions via developer mode. It was pretty cool. 


About Ian Mulvany

Hi, I'm Ian - I work on academic publishing systems. You can find out more about me at mulvany.net. I'm always interested in engaging with folk on these topics, if you have made your way here don't hesitate to reach out if there is anything you want to share, discuss, or ask for help with!