I want to open a URL from my current Cocoa app in Safari, but the thing is that I don't want the Safari UI to be visible to user. i.e. Safari should be executed in background without showing what is happening in it.
Is it possible ?

If yes please tell the method to do it.
I want it on urgent basis.
Thanks :)

1 Answer
1

You may open the URL in a web view by using WebView class and don't make the WebView visible to user if safari is not a compulsory requirement.

OR

You may use Scripting Bridge framework to minimize the application safari or use other methods in header file Safari.h to run it in background after opening the URL.
You may go through this link to know more about Scripting Bridge. For your task follow the steps below:

Generate a header file for safari, using the terminal command below:

sdef /Applications/Safari.app | sdp -fh --basename Safari

Now, check your home folder or the current directory from which terminal cmd is executed to see a file Safari.h
Drag this file and add it to your project.
Add ScriptingBridge.Framework to your project.