Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access to Safari bookmarks from another application

I was wondering how we can access Safari bookmarks from another Cocoa application on Mac OS X, in a way that is safe and secure for the future.

As you may know, two mechanisms were common to retreive Safari bookmarks:

  • either read Safari's Bookmarks.plist file
  • or use the SyncServices API.

However, the first is forbidden by sandboxing (mandatory for a distribution through the App Store), and the second has been deprecated since Mac OS X 10.7 Lion.

I believe that Apple deprecated SyncServices in favour of iCloud synching, but I can't find any iCloud API that allow access to the bookmarks (1).

Any hint on where to look? Native Cocoa is preferred, but any non-deprecated, sandboxing-compatible solution is welcome.

Thanks.

(1) and, honestly, going through the internet (and thus requiring an internet connexion) to retrieve on a machine something on the same machine seems... awkward — but well, if it was the way to go at least that would be a possibility.

like image 380
KPM Avatar asked Jul 21 '12 12:07

KPM


People also ask

Can I access my bookmarks from another computer?

You can also use Google bookmarks for accessing your bookmarks and store them on your account to access them anywhere. Go to Google bookmarks then login with your Google account. With Google Bookmarks, you can save shortcuts to your favorite webpages and navigate to them in seconds from anywhere.

How do I share my Safari bookmarks with Chrome?

On your iPad or iPhone, navigate to Settings > Profile > iCloud and turn on the switch for Safari. Next, enable Safari sync on Mac. Find the iCloud in the System Preferences and check the toggle for Safari. Open Google Chrome on your Mac and import Safari bookmarks using the steps laid out in the previous section.

How to import bookmarks from safari to Chrome?

Open Safari. In the menu bar at the top, click the “ File ” menu. Select “Import From” and click either the browser of your choice for synchronization or “ BookmarksHTML file ”. If you choose synchronization, select the “ Bookmarks ” checkbox in the following dialog and then click “ Import ”.

How to manage bookmarks in Safari on Mac?

When you sit down at your Mac and open Safari, you’ll want easy access to your bookmarks along with simple ways to manage them. When you’re on a webpage that you want to bookmark, you have a couple of easy ways to do it. Click Bookmarks > Add Bookmark from the menu bar. Hit the Share button and pick Add Bookmark.

How to sync bookmarks between Safari and Microsoft Edge?

Open Safari browser, and go to File menu -> Import From -> Bookmarks HTML File… Sync and merge bookmarks between Safari, Microsoft Edge Avoid duplicate bookmarks and messy directories after importing bookmarks, we recommend using One Bookmark to sync and merge bookmarks from Safari, Microsoft Edge, Chrome, Firefox, Opera browsers.

How to view bookmarks on MacBook Air?

Just like adding a bookmark to Safari, you have a few quick ways to access your bookmarks. Click Bookmarks > Show Bookmarks from the menu bar. Select View > Show Bookmarks Sidebar from the menu bar. Click the Show Sidebar button in your toolbar and select the Bookmarks tab at the top.


1 Answers

You can read out the bookmarks plist file even when running in a sandbox if you expressly ask the user for consent: Present an open panel pointing to the plist directory and store the security-scoped bookmark you receive from it. I did this and my app wasn't rejected for this (but for other things).

like image 60
Tim Avatar answered Oct 01 '22 15:10

Tim