I am looking for an API

24 views
Skip to first unread message

Naomi

unread,
Jun 18, 2015, 3:11:53 PM6/18/15
to swift-l...@googlegroups.com
Dear all,

To develop a small native application in Swift, i need a REST API
that tells the application, in real time, the url of the browser ( Chrome if possible, otherwise Firefox, Safari at worst ) that is on the terminal where this application is installed.

Unfortunately, i didn't find this API on internet.

Do you know if this API exists or do you know where can i find it ?

Thank you.

Best regards,

Naomi




Kevin Greene

unread,
Jun 18, 2015, 3:25:38 PM6/18/15
to Naomi, swift-l...@googlegroups.com
I'm confused. So you're building an app for iPhone? That app wants to somehow get "the url of the browser". What do you mean by that? Also, what do you mean by "the terminal where this application is installed"? Do you mean the phone that the app is installed on? Or something else?

--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swift-languag...@googlegroups.com.
To post to this group, send email to swift-l...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/f42c9517-1deb-482e-9cd0-7eb2a3142c4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jens Alfke

unread,
Jun 18, 2015, 3:56:48 PM6/18/15
to Naomi, swift-l...@googlegroups.com

On Jun 18, 2015, at 12:11 PM, Naomi <naomija...@gmail.com> wrote:

To develop a small native application in Swift, i need a REST API that tells the application, in real time, the url of the browser ( Chrome if possible, otherwise Firefox, Safari at worst ) that is on the terminal where this application is installed.

A browser doesn’t have a URL. A browser connects to resources that have URLs.

It sounds like you want to write an application that can display content in a web browser? If so, the application will need to include a small HTTP server that will listen for connections on a TCP port, and then the user would have their browser go to the URL corresponding to that listener; something like http://localhost:54321/ .

—Jens
Message has been deleted
Message has been deleted

Naomi

unread,
Jun 18, 2015, 4:46:01 PM6/18/15
to swift-l...@googlegroups.com, naomija...@gmail.com
Dear Kevin, Dear Jens,

You are right. I made mistakes. I'm sorry.

I would like to build an application

1) for all Apple devices : iMac ; IPad ; IPhone ; ...

2) that can display in a web browser some informations relating to the informations contained in each web pages visited by the user of this application.

So, when a browser is connected to resources, something must indicate to this application, in real time, the URLs of this resources.

Consequence : the application appears in the browser some informations relating to the viewed web page.

Naomi
Message has been deleted

Naomi

unread,
Jun 18, 2015, 5:46:18 PM6/18/15
to swift-l...@googlegroups.com
It seems to me that the approach that I seek is as follows :

1) to listen TCP port to identify the IP
address to which the browser connects to time t ;

In this case, I need to find a website or a book relating to the "network interaction" with the Swift language.

Do you know this website or this book ?

2) to convert this IP address in URL ;

3) to communicate this URL to the application.

Kevin Greene

unread,
Jun 18, 2015, 6:05:36 PM6/18/15
to Naomi, swift-l...@googlegroups.com
It sounds like you want to build an application that tracks a user's browsing history?

On iOS each app is sandboxed, meaning that your app has no way of interacting with other apps like you described. You can't build an app that tracks a user's browsing history in the chrome app. It's simply not possible on iOS, for very good reasons. 

In either case, this is not really related to the swift language, so it's off topic for this mailing list.
--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swift-languag...@googlegroups.com.
To post to this group, send email to swift-l...@googlegroups.com.

Jens Alfke

unread,
Jun 18, 2015, 6:09:40 PM6/18/15
to Naomi, swift-l...@googlegroups.com

On Jun 18, 2015, at 2:45 PM, Naomi <naomija...@gmail.com> wrote:

1) to listen TCP port to identify the IP address to which the browser connects to time t ;

Sorry, there isn’t anything that will do that. It would be a privacy problem because it would allow arbitrary apps (and even code on other computers, since you’re asking for a network socket to be exposed!) to snoop on your web browsing.

On Mac OS you can write a Safari or Chrome extension that runs inside the browser and can look at what pages are loaded, and the contents of those pages. Maybe that’s the sort of thing you’re looking for. (I don’t think you can write these in Swift though, only JavaScript.)

On iOS browser extensions aren’t supported, so you can’t do anything like this.

Anyway, this is not a Swift language topic, so it’s not relevant to this list — you’d be better off asking for help on Apple’s or Google’s developer forums for browser extension development.

—Jens

Naomi

unread,
Jun 19, 2015, 5:47:12 AM6/19/15
to swift-l...@googlegroups.com, naomija...@gmail.com
Dear Jens,

Thank you for your answer.

I will follow your advices.

Best regards

Naomi
Reply all
Reply to author
Forward
0 new messages