Search code examples
ios8mobile-safariactionios8-extension

iOS 8 Action Extension for selected text in 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.


Solution

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

    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()