Cannot Get Web Content from a Safari Action/Sharing Extension

Originator:AriXmail
Number:rdar://17274783 Date Originated:11-Jun-2014 01:35 PM
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 8 beta 1
Classification: Reproducible:Always
 
Summary:
iOS 8's action & sharing extensions are awesome, and when run, they provide interesting JavaScript preprocessing functionality and access to the website's DOM.

But in many cases, it is necessary for an extension to be able to access the page contents (or the selected page contents) and this is difficult to do using the current APIs. Action/sharing extensions should include functionality to return rich text (web archive, HTML, RTF, RTFd, NSAttributedString, etc.) to the extension itself.

This would fit cleanly into the existing public APIs. Simply include an NSItemProvider that provides rich text and/or fill in the attributedContentText property in the NSExtensionItem that Safari returns to action/sharing extensions.

This functionality would also be easy to implement. When the user copies content from a UIWebView, the content is automatically copied to the pasteboard in several formats, including web archive and RTF.

Steps to Reproduce:
1. Create an action extension that logs the returned NSExtensionItems
2. Install it onto an iOS 8 device
3. Trigger the extension from Safari


Expected Results:
Safari should return the contents of the web page.

Actual Results:
The returned NSExtensionItems do not include the contents of the web page

Version:
8.0 beta 1

Notes:


Configuration:
iOS 8, regardless of device

Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!