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.
Asked
Active
Viewed 765 times
0
-
Please add some code indicating what you've tried and where the problem is. – Ryan Kohn Sep 26 '14 at 16:09
1 Answers
0
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()

honcheng
- 2,014
- 13
- 14
-
Did you try out this code? I've done exactly as described but document.getSelection().toString() always returns an empty string. (Returning other data from the javascript works as expected.) – Brett Hannah Oct 09 '14 at 07:09
-
-
-
@honcheng `I have an app out that uses it.` I would love to check your app out. Can you please post the link? – Matt Apr 02 '15 at 13:08