Closed Bug 1747368 Opened 3 years ago Closed 3 years ago

Content being copied from address bar is not the content visible at the copying time

Categories

(Firefox :: Address Bar, defect, P3)

Firefox 95
x86_64
macOS
defect

Tracking

()

RESOLVED DUPLICATE of bug 1770723

People

(Reporter: arthit, Unassigned)

Details

Steps to reproduce

  1. Open a URL, a web page will be displayed
  2. Copy (Cmd+C) any content from the web page
  3. Select the whole URL (Cmd+A) in the address bar, and paste (Cmd+V) the content in the clipboard to the address bar (will replace the URL)
  4. Copy the whole content of the address bar
  5. Paste it in a text editor

Expected results

The content that got pasted at (5) is the content that got pasted at step (3) (and being copied at step (4)).

Actual results

The content that got pasted at (5) is the URL from step (1)

*This behavior does not always observable, but it occurs frequently enough to get noticed.

Strange but not impossible since the urlbar has a custom copy controller. The next time you notice it, could you let us know about the following please?

  • Any errors in the browser console?
  • What is the text you pasted into the urlbar? (If you don't mind sharing it)
  • Are there any steps between 3 and 4? For example did you switch tabs, load a web page, anything like that?
  • Please run the following in the browser console and report the output here (if you don't mind sharing it):
(function(){
console.log(`_getSelectedValueForClipboard:`, gURLBar._getSelectedValueForClipboard());
console.log(`selectionStart:`, gURLBar.selectionStart);
console.log(`valueIsTyped:`, gURLBar.valueIsTyped);
console.log(`value:`, gURLBar.value);
console.log(`_untrimmedValue:`, gURLBar._untrimmedValue);
console.log(`pageproxystate:`, gURLBar.getAttribute("pageproxystate"));
})();
Severity: -- → S3
Priority: -- → P3

I went straight from step 3 to step 4.

--

The text that I usually pasted to the urlbar is mixed.
Most of the time, they are formatted text from a news website, or a PDF, or a Google Sheets.

The context is I'm writing something in my word processor (either online Google Docs or offline Libre Office/Microsoft Word)
and I'm doing some research using Firefox. I found some text I want to quote, so I copy it from the web page.

But instead of paste the text directly to the word processor, I paste it to urlbar first, then copy it from the urlbar, then paste it to my word processor.

I'm doing this as a quick way to get rid of formatting and have only plain text.

--

Will run the code once I encounter with it again. Thank you.

Ran the snippet and I got this:

Uncaught ReferenceError: gURLBar is not defined
    <anonymous> debugger eval code:2
    <anonymous> debugger eval code:8
debugger eval code:2:1
    <anonymous> debugger eval code:2
    <anonymous> debugger eval code:8

Thanks, but it looks like you might have run it in the devtools console and not the browser console? By browser console, I mean the menu Tools > Browser Tools > Browser Console (Shift-Cmd-J).

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.