适用于Safari中所选文本的iOS 8 Action Extension [英] iOS 8 Action Extension for selected text in Safari

查看:132
本文介绍了适用于Safari中所选文本的iOS 8 Action Extension的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法让Action Extensions与Safari中的选定文本一起使用。
内部激活规则有允许文本的规则,但是当我选择文本时扩展名不可用。

I can't get Action Extensions to work with selected text in safari. Inside Activation rules there is the rule to allow text, but the extension is not available when I select the text.

推荐答案

您需要启用NSExtensionActivationSupportsWebURLWithMaxCount以在Safari中提供扩展。

You need to turn on NSExtensionActivationSupportsWebURLWithMaxCount to make extension available in Safari.

从模板创建非UI动作扩展目标时,会自动创建Action.js文件。编辑文件以使用

When you create a non-UI action extension target from the template, an Action.js file is automatically created. Edit the file to send back the selected text using

document.getSelection().toString()

这篇关于适用于Safari中所选文本的iOS 8 Action Extension的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆