ViennaRSS / vienna-rss

Vienna is a free and open-source RSS/Atom newsreader for macOS.
https://www.vienna-rss.com
Apache License 2.0
1.85k stars 227 forks source link

Enrich context actions #1439

Open dumprop opened 3 years ago

dumprop commented 3 years ago

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

TAKeanice commented 3 years ago

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 commented 3 years ago

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

Eitot commented 3 years ago

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…

dumprop commented 3 years ago

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

Eitot commented 3 years ago

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.

TAKeanice commented 3 years ago

@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.

dumprop commented 3 years ago

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(

TAKeanice commented 3 years ago

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

dumprop commented 3 years ago

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

TAKeanice commented 3 years ago

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

Eitot commented 3 years ago

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

stale[bot] commented 2 years ago

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.

dumprop commented 2 years ago

no plz

github-actions[bot] commented 1 year ago

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.

dumprop commented 1 year ago

no plz