vienna-rss icon indicating copy to clipboard operation
vienna-rss copied to clipboard

Enrich context actions

Open dumprop opened this issue 3 years ago • 15 comments

When I get a message in email w/ date I can quickly add it to calendar (context prompts) image

When I get it in Vienna there no something like that image

Feed: http://www.mathnet.ru/rss/rssSeminars.phtml?option_lang=eng

dumprop avatar Feb 13 '21 13:02 dumprop

Seems to be like another thing that Apple keeps away from the Mac. https://developer.apple.com/documentation/webkit/wkwebviewconfiguration/1641937-datadetectortypes would be the solution but is only available on iOS or in Catalyst apps. Maybe we can find another private property on WKWebView @Eitot ?

TAKeanice avatar Feb 17 '21 07:02 TAKeanice

Even UIWebView has it only for iOS: https://developer.apple.com/documentation/uikit/uiwebview/1617965-datadetectortypes

TAKeanice avatar Feb 17 '21 07:02 TAKeanice

I came to the same conclusion a few days ago. I think the only way is by using NSDataDetector.

I am not sure how this feature works, however. I don't think it supports this UI that apps like Mail have. It might not be trivial to implement this in a web view.

Maybe there is a private API in WebKit…

Eitot avatar Feb 17 '21 18:02 Eitot

I know that canary mail on iOS too have something like that

dumprop avatar Feb 23 '21 12:02 dumprop

I have not come across a private API in WKWebKit either. Since WKWebKit is opaque and run in a separate system-controlled process, I do not see how this could be added. Apple Mail seems to be using a whole private framework. Safari itself does not support this either.

Eitot avatar Feb 23 '21 15:02 Eitot

@dumprop the problem here is that we use a WebView to display the articles, and what you want works on (an attributed) TextView like the mentioned mail app probably uses, and in iOS. The only option I see is that we take the text readable on the page and process it with data recognizers. We could probably show the results on top or bottom of the article like Apple Mail does. That's a bunch of work though. If you're willing to contribute, I am happy to give you some pointers to implementing it.

TAKeanice avatar Feb 23 '21 16:02 TAKeanice

Apple Mail seems to be using a whole private framework

I don't think so because I have 3 party apps (on iOS) which same feature

Safari itself does not support this either.

Yes(

dumprop avatar Feb 23 '21 16:02 dumprop

Apple Mail seems to be using a whole private framework

I don't think so because I have 3 party apps (on iOS) which same feature

As I said, what you're asking does work in WebViews on iOS, but not macOS

TAKeanice avatar Feb 23 '21 18:02 TAKeanice

Apple Mail seems to be using a whole private framework

I don't think so because I have 3 party apps (on iOS) which same feature

As I said, what you're asking does work in WebViews on iOS, but not macOS

There was a suspicion that it works on mac too because on macOS I always use only browser Hopefully in time this will appear on the macOS too

dumprop avatar Feb 23 '21 18:02 dumprop

These are the relevant pieces of WKWebView: https://github.com/WebKit/WebKit/blob/1b30c2033f0a537c4acc3372b63e22e8ff1e6e68/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm#L159 https://github.com/WebKit/WebKit/blob/1b30c2033f0a537c4acc3372b63e22e8ff1e6e68/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm#L535 https://github.com/WebKit/WebKit/blob/1b30c2033f0a537c4acc3372b63e22e8ff1e6e68/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm#L3246

TAKeanice avatar Feb 27 '21 17:02 TAKeanice

Only some of the logic is platform-independent, the implementation for macOS is incomplete. Lots of references to that build option pertain to iOS.

Eitot avatar Feb 28 '21 16:02 Eitot

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 02 '22 02:03 stale[bot]

no plz

dumprop avatar Mar 02 '22 21:03 dumprop

This issue hasn't been updated in a while so we're going to mark it as stale. stale issues will automatically be closed after 60 days of inactivity. If this issue is still affecting you, please update us on how it affects you, and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. Thank you for your contributions.

github-actions[bot] avatar Mar 04 '23 02:03 github-actions[bot]

no plz

dumprop avatar Mar 04 '23 08:03 dumprop