site_archiver@lists.apple.com Delivered-To: Cocoa-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1501369311; bh=YQN5KCP7WRy8Q0V9D4IaDQuNYE5XMe5lX+v03FUDLTk=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=C/vhZSSPT6Fjtz3MELy7a5Apx7v+XfNo3Y3sYP4mtiaKZH7rDeOFpnJUZQOSX6T07 WN5x5KkmyNSWZGaLMv9FqY6IY2VQ6h4SiAUw6gaN0P/6UxMcAvY8lwNFP5ptBMDJHq oOtyrDHmadn+pxCwYnsoSuyKW/UtD2IlfDuRUUOKYybu7S8UtTaMxFBxShvqBbN/1f QbKpMnKdRXYzXcPaeqpo+68oDAEIAtRV73hOdppKXQ7/cY2NlzcdP8kJ83seaXu5N5 GkvwMadQIRJsBqas2Ih58ZWh7AiYz5GdnFmV0j+YdXmIZQeP8fRA+di8IN9JAqUfiD Z/y52tglnN6QQ==
On Jul 26, 2017, at 9:13 PM, Conrad Shultz <conrad_shultz@apple.com> wrote:
On Jul 22, 2017, at 7:32 PM, Jens Alfke <jens@mooseyard.com> wrote:
On Jul 21, 2017, at 7:19 PM, Conrad Shultz <conrad_shultz@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/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com