-
Notifications
You must be signed in to change notification settings - Fork 440
Ref #1499: Add link preview to long press context menu. #1625
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, Safari provides a way to disable these previews, we may want to give the same option to users
@@ -2511,11 +2511,21 @@ extension BrowserViewController: WKUIDelegate { | |||
return UIMenu(title: url.absoluteString, children: actions) | |||
} | |||
|
|||
let config = UIContextMenuConfiguration(identifier: nil, previewProvider: nil, actionProvider: actionProvider) | |||
let linkPreview: UIContextMenuContentPreviewProvider = { | |||
return SFSafariViewController(url: url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to make our own preview provider that uses BVC in some way (so shields are loaded in and such)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UIContextMenuContentPreviewProvider accepts any UIViewController
so we could try to add some custom view with content blocker lists
Sorry that review meant to be |
I think I should add a preference to hide preview links, similar to what Safari does at the moment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh, never mind, that list scrolls, and wasn't visible because of the super long URL… Not sure if we should truncate it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me
Summary of Changes
Submitter Checklist:
NSLocalizableString()
Test Plan:
Screenshots:
Reviewer Checklist:
QA/(Yes|No)
release-notes/(include|exclude)
bug
/enhancement