This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
For #23697: Fix up paste and paste-go handling for certain types of clipboard items #24294
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grigoryk
force-pushed
the
issue23697Broken
branch
from
March 16, 2022 03:08
5232e3a
to
a8038d7
Compare
Tested this on a Pixel5 running Android 12, and a recent Samsung device. |
grigoryk
changed the title
For #23697: Fix up paste and paste-go handling in for certain types of clipboard items
For #23697: Fix up paste and paste-go handling for certain types of clipboard items
Mar 16, 2022
This was referenced Mar 16, 2022
…xt as url It seems like this is the MIME type we're getting from the clipboard in certain scenarios, e.g. after copying a link from Chrome or Gmail on some devices.
grigoryk
force-pushed
the
issue23697Broken
branch
from
March 16, 2022 20:26
a8038d7
to
4aa03b2
Compare
@@ -81,12 +81,14 @@ object ToolbarPopupWindow { | |||
} | |||
} | |||
|
|||
clipboardUrl?.let { url -> | |||
clipboardText?.let { text -> |
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.
It would be nice to add some tests for this in ToolbarPopupWindowTest as well. Can we file a good-first-bug issue for this?
gabrielluong
approved these changes
Mar 16, 2022
grigoryk
added
the
pr:needs-landing
PRs that are ready to land [Will be merged by Mergify]
label
Mar 16, 2022
This was referenced Oct 10, 2022
4 tasks
4 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow-up to #24180 which adds handling for a few clipboard paste/paste-go cases. Specifically, I observed that in certain cases when copying links from, say, Chrome, we'd get MIME type
text/x-moz-url
for the clipboard item, which we weren't recognizing.Additionally, second commit here allows pasting non-url contents of the clipboard (after stripping them).
Note that there's also a
text/uri-list
MIME type, used for passing around one or more URLs. Currently we don't support it - e.g. we'd need to make assumptions about its associated contents, etc. In my testing I haven't yet seen it used in context of a clipboard copy/paste.Pull Request checklist
To download an APK when reviewing a PR: