New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FXIOS-6047 - iOS No Longer Asking For Permission To Paste URL #20200
base: main
Are you sure you want to change the base?
Conversation
Thanks for this PR @tisumi99! Can you clarify the before/after UI, it looks like a few changes have been made (for ex. we're no longer displaying the destination URL to the user in the toast |
@mattreaganmozilla The UI for This blog post does a pretty job summarizing the pasteboard security changes that happened in iOS16: Links to |
Thanks @tisumi99, I understand the rationale for the changes, just wanted to clarify if there had been discussions outside of the ticket on the UI changes, since the update here differs from the expected behavior listed in the ticket afaics (though I don't have 100% context on that). This LGTM though, I'm reaching out to the team to confirm if there are any other steps that may be needed for this UI update. |
@mattreaganmozilla I originally did have a fix that did as the ticket asked for. I had The only other option I can think of is to not make any changes to the app and let users know that they have to give Firefox permission to read the pasteboard in iOS settings to avoid constantly being asked for permission. Asking for permission each time the pasteboard is read is the default setting. |
Thanks again @tisumi99 for your work on this. 👍 The change makes sense to me (and thank you for the well-written PR description and screenshots). I'm just double-checking a couple things, should have it reviewed shortly. |
@tisumi99 Would you mind rebasing this branch against current |
…ers to give paste permission every time app is brought to the foreground and app attemps to read the URL in the clipboard.
…16.0, *)` instead of using `if #available(iOS 16.0, *)` inside the method.
Hi @tisumi99, it looks like something may have gone awry with the the rebase you made (diff is now showing 289 files changed). Can you please try to correct it? If you run into further difficulties you can alternatively open a new PR if needed (cherry-pick your original changes to it, and then just message me the new PR link here), and we can close this one. |
5903165
to
30a0d13
Compare
@mattreaganmozilla |
Client.app: Coverage: 30.92
Generated by 🚫 Danger Swift against 30a0d13 |
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.
Thanks @tisumi99 for your work on this, LGTM. 👍 I'm just confirming the UI change with the UX team and then I'll merge.
@tisumi99 Just wanted to let you know I haven't forgotten about this PR, I'm waiting to get confirmation on the UI changes with our UX team which is something we try to do whenever UI is updated. As soon as I hear back I'll update. Thanks again for this PR. |
Thanks for the update @mattreaganmozilla . |
@tisumi99 Still waiting for confirmation from UX team (they like to review UI changes whenever possible before merging). That process can sometimes take a while, but I'll update as soon as I hear back. Thank you |
📜 Tickets
Jira ticket
Github issue
💡 Description
Replaced
UIButton
withUIPasteControl
in URL toast for iOS 16 and above. This fixes the attached issue as the app will no longer read the clipboard without user interaction. Clicking onUIPasteControl
gives the app permission to read the clipboard. Issue does not exist prior to iOS 16 asUIPasteControl
and the clipboard security measures were released in iOS 16.Added subclass
PasteControlToast: ButtonToast
. Subclass replacesUIButton
withUIPasteControl
.Added method
BrowserController.paste()
. This method is called afterUIPasteControl
is cliked. Method gets the URL from the clipboard and opens a new browser tab with the URL.Added method
BrowserViewController.shouldDisplay()
as delegate forClipboardBarDisplayHandler
. Method setsview.pasteConfiguration
and configures URL toast.Added branched code to
ClipboardBarDisplayHandler.checkIfShouldDisplayBar()
to callBrowserViewController.shouldDisplay()
instead ofBrowserViewController.shouldDisplay(clipBoardURL:)
if iOS 16 or greater. The branched code does not read the clipboard as that would trigger iOS to ask for user permission. Instead, app waits untilUIPasteControl
is clicked to read the clipboard.Added method
ClipboardBarDisplayHandler.shouldDisplayBar(pasteBoardChangeCount:)
. Since app cannot read the clipboard without iOS asking for user permission, app is now usingUIPasteboard.general.changeCount
to check if the clipboard contents have changed. CheckingchangeCount
does not required user permission.📝 Checklist
You have to check all boxes before merging
@Mergifyio backport release/v120
)