I am looking for an API

已查看 25 次
跳至第一个未读帖子

Naomi

未读,
2015年6月18日 15:11:532015/6/18
收件人 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

未读,
2015年6月18日 15:25:382015/6/18
收件人 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

未读,
2015年6月18日 15:56:482015/6/18
收件人 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
已删除帖子
已删除帖子

Naomi

未读,
2015年6月18日 16:46:012015/6/18
收件人 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
已删除帖子

Naomi

未读,
2015年6月18日 17:46:182015/6/18
收件人 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

未读,
2015年6月18日 18:05:362015/6/18
收件人 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

未读,
2015年6月18日 18:09:402015/6/18
收件人 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

未读,
2015年6月19日 05:47:122015/6/19
收件人 swift-l...@googlegroups.com、naomija...@gmail.com
Dear Jens,

Thank you for your answer.

I will follow your advices.

Best regards

Naomi
回复全部
回复作者
转发
0 个新帖子