Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[Bug]: Can't paste non url text when url bar is empty #27182

Closed
Timshel opened this issue Sep 26, 2022 · 15 comments
Closed

[Bug]: Can't paste non url text when url bar is empty #27182

Timshel opened this issue Sep 26, 2022 · 15 comments
Labels
🐞 bug Crashes, Something isn't working, .. Feature:TextSelection

Comments

@Timshel
Copy link

Timshel commented Sep 26, 2022

Steps to reproduce

  1. Select some text to copy
  2. Ensure that the url is empty
  3. Ensure that the you are not editing the url bar field (keyboard is closed)
  4. Long press on the url bar
  5. If activated the phone will vribrate

Expected behaviour

The paste option should appear.

Actual behaviour

Nothing is displayed, you can't paste.

Device name

Google Pixel 4a (5G) on CalyxOS

Android version

Android 12

Firefox release type

Firefox

Firefox version

105.1.0

Device logs

No response

Additional information

I don't know if initially the feature was supposed to support only url but I believe this is confusing / a bug because :

  1. The field combine search and urlbar and is labelled : Search or enter address
  2. If there is already an url then both option appear : Copy and Paste
  3. The phone give a vibrating feedback (an OS notification might appear If I long-press on URL bar with an externally-copied URL in my clipboard, Android spams a notification "Firefox pasted from your clipboard" which is confusing and covers up the actual "paste" option #26564) but there is no change visible to the user.

┆Issue is synchronized with this Jira Task

@Timshel Timshel added needs:triage Issue needs triage 🐞 bug Crashes, Something isn't working, .. labels Sep 26, 2022
Timshel pushed a commit to Timshel/fenix that referenced this issue Sep 26, 2022
@github-actions github-actions bot added the eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged label Sep 26, 2022
@LaurentiuApahideanSV
Copy link

I can confirm the issue is reproducible on Fenix Nightly 107.0a1 2022-10-05 using the steps mentioned in the description.

Devices used:

  • Google Pixel 6 (Android 13)
  • Samsung Galaxy S22 Ultra (Android 12)

@jonalmeida
Copy link
Contributor

jonalmeida commented Oct 8, 2022

We are intentional with not pasting from the clipboard if the contents are not a URL because it has security implications, if I recall correctly. This is in keeping with other browsers as well.

cc: @LaurentiuApahideanSV for reference.

@Timshel
Copy link
Author

Timshel commented Oct 8, 2022

@jonalmeida could you give more details on the security implications ?

Because I find it surprising since :

  • As I mentioned if there is text in the urlbar then it's possible to paste, is this a bug ? or is there different security concerns if we already have an url present ?
  • If I select the url bar itself then it's possible to paste since the handling is done by the OS I believe

@Mugurell
Copy link
Contributor

Work around this was done in #22271. Maybe @Amejia481 has more context.

@Timshel
Copy link
Author

Timshel commented Oct 10, 2022

It appears at the time the Paste option was available only when there was an url but later on in #24294 it was made possible to paste non-url content.

@Timshel
Copy link
Author

Timshel commented Oct 10, 2022

Since I rewrote a significant part of the logic when fixing #26564 i included it in #27351

@Amejia481
Copy link
Contributor

Work around this was done in #22271. Maybe @Amejia481 has more context.

👋🏽
Sorry, I don't have context around this bug 😅 , the work on #22271 was more to address an issue on Android 12.

@jonalmeida
Copy link
Contributor

If I select the url bar itself then it's possible to paste since the handling is done by the OS I believe

Correct. We want to be careful about what we hint to the user should be copied to the clipboard. There are more nuanced reasons that the security team has more details on.

In general, we want to hint to our users to paste a URL because we can evaluate that safely and not recommend that they paste anything in their clipboard which might end up being a password or login details.

@Timshel
Copy link
Author

Timshel commented Oct 12, 2022

Hi, as I mentioned I would be interested in those details :). I can understand being cautious about the clipboard if we were in the context of a login/password form but it's not the case here.

Unless I misunderstood, the point of this functionality is to facilitate interaction with the awesome bar. The bar itself is named Search or enter address and when selected allow to paste any content. With the Search part being mentioned first not supporting pasting non-url would seem a strange ux choice that as I user I do not understand.

Additionally the bug is not about adding the paste feature it's already present, it's about it not being possible when the field is empty. For security I see no reason for the differentiation and from an ux point of view it's even less understandable.

From what I can see :

Timshel pushed a commit to Timshel/fenix that referenced this issue Oct 18, 2022
…ad clipboard content and allow to paste non url
@Timshel
Copy link
Author

Timshel commented Oct 25, 2022

Hey,
I would be interested on some feedback on my latest comment and the associated PR I created :).

@Timshel
Copy link
Author

Timshel commented Nov 2, 2022

Ping

@Timshel
Copy link
Author

Timshel commented Nov 15, 2022

Pong

Timshel pushed a commit to Timshel/fenix that referenced this issue Nov 17, 2022
…ad clipboard content and allow to paste non url

Fixes

Update app/src/main/java/org/mozilla/fenix/utils/ClipboardHandler.kt

Co-authored-by: Gabriel Luong <gabriel.luong@gmail.com>

Update app/src/main/java/org/mozilla/fenix/utils/ClipboardHandler.kt

Co-authored-by: Gabriel Luong <gabriel.luong@gmail.com>

fix

fix
@Timshel
Copy link
Author

Timshel commented Jan 3, 2023

Ping

@cpeterso
Copy link

Moved to bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1810044

Change performed by the Move to Bugzilla add-on.

@github-actions github-actions bot reopened this Jan 12, 2023
@github-actions github-actions bot added eng:qa:needed QA Needed and removed eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged labels Jan 12, 2023
@cpeterso cpeterso removed eng:qa:verified QA Verified eng:qa:needed QA Needed needs:triage Issue needs triage labels Jan 13, 2023
@cpeterso
Copy link

QA is not needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Crashes, Something isn't working, .. Feature:TextSelection
Projects
None yet
6 participants