原生 iOS 应用程序可以与 Safari 浏览器交互吗?
我想启用本机 iOS 应用程序和 Safari 浏览器之间的交互,以便在网页上的图像上点击右键单击,在上下文菜单中提供一个选项,将图像发送到另一个自定义编写的本机浏览器用于进一步处理和/或存储的 iOS 应用程序。
但是,根据这篇文章来自 Safari 开发者库的信息,“iOS 目前不支持 Safari 扩展”。
有没有其他替代方案来实现上述功能?
I would like to enable interaction between a native iOS application and the Safari browser such that tapping a right click on an image on a webpage provides an option in the context menu to send the image to another custom written native iOS application for further processing and/or storage.
However, according to this article from Safari Developer Library, “Safari extensions are not currently supported on iOS”.
Is there any other alternative to achieve the above functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您在这里有多种选择:
但是似乎即使这对于 DOC、PDF 甚至自定义类型等任何类型都完美适用,它不适用于图像,这似乎是在iOS 的单独方式 :(
然后解决方案是在您的网页中添加一些代码。点击图像后,如果您注册了“myimageeditor://”URL,则要求 Safari 打开 URL“myimageeditor://edit?url=http://www.url.of/your/image.jpg”。方案,然后您的应用程序将使用参数中的 URL 打开,然后您就可以使用嵌入 URL 检索图像。
You have multiple choices here:
But it seems that even if this works perfectly for any type like DOC, PDF, or even custom types, it does not work for images, which seems to be handled in a separate way by iOS :(
The solution then is to add some code in your web page so that when the image is tapped, you ask Safari to open the URL "myimageditor://edit?url=http://www.url.of/your/image.jpg". If you registered for the "myimageeditor://" URL scheme, you app will then open with the URL in the parameters, and you then will be able to retrieve the image using the embed URL.
我认为只有越狱设备才有可能。
I think it is possible only for jailbroken devices.