chatgpt.com - No text copied in input field
Categories
(Web Compatibility :: Site Reports, defect, P2)
Tracking
(firefox127 affected, firefox129 affected)
People
(Reporter: railioaie, Unassigned)
References
(Depends on 1 open bug, )
Details
(Keywords: webcompat:platform-bug, webcompat:site-report)
User Story
platform:windows,mac,linux,android impact:workflow-broken configuration:general affects:all
Attachments
(1 file)
1.30 MB,
video/mp4
|
Details |
Environment:
Operating System: Windows 10
Firefox version: Firefox Nightly 129.0a1 (2024-06-11) / Firefox Release 127.0
Preconditions:
Clean profile
Steps to reproduce:
- Navigate on https://chatgpt.com/
- Ask something
- After ChatGPT responds, hover the mouse over the text you sent and a pencil mark will appear
- Click the pencil mark
- Select the text and copy
- Paste the selected text in the input field
- Observe the page
Expected Behavior:
The text should be copied in input field
Actual Behavior:
No text copied in input field
Notes:
- Reproduces regardless of the status of ETP
- Reproduces in Firefox Nightly, Firefox Release
- Does not reproduce in Chrome
Updated•4 months ago
|
Updated•2 months ago
|
Comment 2•2 months ago
•
|
||
The problem here is that window.getSelection().toString() returns an empty string, only in Firefox:
e.preventDefault();
const n = window.getSelection();
if (n && n.rangeCount > 0) {
const a = n.getRangeAt(0).cloneContents();
t(a);
const o = document.createElement('div');
o.appendChild(a);
const s = o.innerHTML;
e.clipboardData.setData('text/html', s),
e.clipboardData.setData('text/plain', n.toString())
}
This depends on bug85686 (and related bug1527627)
Updated•2 months ago
|
Updated•2 months ago
|
Comment 3•1 month ago
|
||
Ksenia Berezina wrote:
The problem here is that
window.getSelection().toString()
returns an empty string, only in Firefox
I stepped through the current ChatGPT minified JS in the Firefox debugger and verified that this is still the case as of time of this writing.
I also wrote an Unlicense'd userscript workaround that targets chatgpt.com. The userscript is on greasyfork.org. I'm not going to link to it because I don't think the code is relevant to the proposed fix path that runs via bug85686 and I don't want to come off as self-promoting or fishing. However, it's easy enough to find on the site as it is listed publicly.
Description
•