Re: [webkit-dev] How to display new MIME types?

2017-07-29 Thread Daryle Walker

> On Jul 26, 2017, at 9:13 PM, Conrad Shultz  wrote:
> 
>> On Jul 22, 2017, at 7:32 PM, Jens Alfke  wrote:
>> 
>>> On Jul 21, 2017, at 7:19 PM, Conrad Shultz  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  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


Re: [webkit-dev] How to display new MIME types?

2017-07-26 Thread じょいすじょん
> On Jul 27, 2017, at 10:13, Conrad Shultz  wrote:
> 
> 
> 
>> On Jul 22, 2017, at 7:32 PM, Jens Alfke  wrote:
>> 
>> 
>>> On Jul 21, 2017, at 7:19 PM, Conrad Shultz  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.
>> 
>> —Jens
>> 
> 
> 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  requesting new 
> functionality.
> 
> 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.
With emulation of the link sniffing, 
would Web Assembly make it doable potentially?
That's a big black box still to me...
> 
> -Conrad
> ___
> 
> 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/dangerwillrobinsondanger%40gmail.com
> 
> This email sent to dangerwillrobinsondan...@gmail.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


Re: [webkit-dev] How to display new MIME types?

2017-07-26 Thread Conrad Shultz


> On Jul 22, 2017, at 7:32 PM, Jens Alfke  wrote:
> 
> 
>> On Jul 21, 2017, at 7:19 PM, Conrad Shultz  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.
> 
> —Jens
> 

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  requesting new 
functionality.

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.

-Conrad
___

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


Re: [webkit-dev] How to display new MIME types?

2017-07-22 Thread Jens Alfke

> On Jul 21, 2017, at 7:19 PM, Conrad Shultz  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.

—Jens

___

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


Re: [webkit-dev] How to display new MIME types?

2017-07-21 Thread Conrad Shultz
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).

I encourage anyone who is interested to learn more at 
https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/SafariAppExtension_PG/index.html
 

 and watch the “Extending your App with Safari App Extensions” session from 
WWDC 2016 (https://developer.apple.com/videos/play/wwdc2016/214/ 
).

If you find that the extension API doesn’t meet your needs, or something isn’t 
behaving as expected, please file a bug report at https://bugreport.apple.com 
.

-Conrad



> On Jul 21, 2017, at 11:32 AM, Saagar Jha  wrote:
> 
> Sorry, I meant extension–the JavaScript (and Swift?)-based ones that Safari 
> currently supports.
> 
> Saagar Jha
> 
>> On Jul 20, 2017, at 17:41, Daryle Walker  wrote:
>> 
>> 
>>> On Jul 20, 2017, at 7:38 PM, Saagar Jha  wrote:
>>> 
>>> I remember asking one of the WebKit engineers a similar question. Her 
>>> response was that NPAPI was basically deprecated, and she suggested writing 
>>> a plugin in that intercepted links and displayed its own UI when necessary.
>> 
>> What kind of plug-in? One still using NPAPI? Some other format?
>> 
>> — 
>> 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/conrad_shultz%40apple.com
> 
> This email sent to conrad_shu...@apple.com



smime.p7s
Description: S/MIME cryptographic signature
___

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


Re: [webkit-dev] How to display new MIME types?

2017-07-21 Thread Saagar Jha
Sorry, I meant extension–the JavaScript (and Swift?)-based ones that Safari 
currently supports.

Saagar Jha

> On Jul 20, 2017, at 17:41, Daryle Walker  wrote:
> 
> 
>> On Jul 20, 2017, at 7:38 PM, Saagar Jha  wrote:
>> 
>> I remember asking one of the WebKit engineers a similar question. Her 
>> response was that NPAPI was basically deprecated, and she suggested writing 
>> a plugin in that intercepted links and displayed its own UI when necessary.
> 
> What kind of plug-in? One still using NPAPI? Some other format?
> 
> — 
> 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


Re: [webkit-dev] How to display new MIME types?

2017-07-20 Thread Daryle Walker

> On Jul 20, 2017, at 7:38 PM, Saagar Jha  wrote:
> 
> I remember asking one of the WebKit engineers a similar question. Her 
> response was that NPAPI was basically deprecated, and she suggested writing a 
> plugin in that intercepted links and displayed its own UI when necessary.

What kind of plug-in? One still using NPAPI? Some other format?

— 
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


Re: [webkit-dev] How to display new MIME types?

2017-07-20 Thread Saagar Jha
I remember asking one of the WebKit engineers a similar question. Her response 
was that NPAPI was basically deprecated, and she suggested writing a plugin in 
that intercepted links and displayed its own UI when necessary.

Saagar Jha

> On Jul 20, 2017, at 15:50, Daryle Walker  wrote:
> 
> [I originally had this on the WebKit development list first.]
> 
>> On Jul 18, 2017, at 3:31 PM, Daryle Walker  wrote:
>> 
>> [I’m not sure this is the right forum.]
>> 
>> If I want Safari for Mac to display a new MIME type, how do I do it? I know 
>> there used to be an Apple-custom API for this, but it was deprecated for 
>> classic Netscape plug-ins long ago. However, those NPAPI plug-ins have been 
>> deprecated themselves across platforms for many years. There are the newest 
>> Safari extensions, which are versions of Apple’s app-extensions API, but 
>> those only do JavaScript modifications and such, and don’t cover new types 
>> (I think). Am I completely out of luck now? Can I still try NPAPI?
> 
> — 
> 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/saagar%40saagarjha.com
> 
> This email sent to saa...@saagarjha.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


Re: [webkit-dev] How to display new MIME types?

2017-07-20 Thread Daryle Walker
[I originally had this on the WebKit development list first.]

> On Jul 18, 2017, at 3:31 PM, Daryle Walker  wrote:
> 
> [I’m not sure this is the right forum.]
> 
> If I want Safari for Mac to display a new MIME type, how do I do it? I know 
> there used to be an Apple-custom API for this, but it was deprecated for 
> classic Netscape plug-ins long ago. However, those NPAPI plug-ins have been 
> deprecated themselves across platforms for many years. There are the newest 
> Safari extensions, which are versions of Apple’s app-extensions API, but 
> those only do JavaScript modifications and such, and don’t cover new types (I 
> think). Am I completely out of luck now? Can I still try NPAPI?

— 
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