> On Jul 26, 2017, at 9:13 PM, Conrad Shultz <conrad_shu...@apple.com> wrote:
> 
>> On Jul 22, 2017, at 7:32 PM, Jens Alfke <j...@mooseyard.com> wrote:
>> 
>>> On Jul 21, 2017, at 7:19 PM, Conrad Shultz <conrad_shu...@apple.com> wrote:
>>> 
>>> You can build a Safari extension as an app extension bundled with an app, 
>>> meaning you can write your extension in Swift or Objective-C (and 
>>> JavaScript).
>> 
>> It doesn’t look like these can do what the OP wants to do — display a 
>> specific MIME type in Safari. Safari Extensions are triggered by web pages 
>> loading, and can inject JS or CSS, which implies that the page is already 
>> HTML-based. If Safari encounters a page whose MIME type is 
>> “application/foobar”, it’s not going to display any HTML, it’s going to 
>> download it as a file and the extension never gets to run.
> 
> Yes, you will not able to directly display a new MIME type in Safari using 
> the existing extensions API. I encourage filing a bug at 
> https://bugreport.apple.com <https://bugreport.apple.com/> requesting new 
> functionality.

#33607778

> However, you might be able to emulate a similar behavior. For example, your 
> extension could add script that detects a link (or other reference) in HTML 
> to the content of interest, then routes it (either as downloaded data or the 
> resource URL) to your native code, which could then render it either in your 
> associated app or in a popover in Safari.

What if my custom type is the first page visited (i.e. no link)?

— 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com 

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to