Open Bug 1902004 Opened 5 months ago Updated 27 days ago

chatgpt.com - No text copied in input field

Categories

(Web Compatibility :: Site Reports, defect, P2)

Firefox 129
Desktop
Windows 10

Tracking

(firefox127 affected, firefox129 affected)

Tracking Status
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)

Environment:
Operating System: Windows 10
Firefox version: Firefox Nightly 129.0a1 (2024-06-11) / Firefox Release 127.0

Preconditions:
Clean profile

Steps to reproduce:

  1. Navigate on https://chatgpt.com/
  2. Ask something
  3. After ChatGPT responds, hover the mouse over the text you sent and a pencil mark will appear
  4. Click the pencil mark
  5. Select the text and copy
  6. Paste the selected text in the input field
  7. 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
Severity: -- → S2
User Story: (updated)
Priority: P3 → P2
Assignee: nobody → kberezina
Status: NEW → ASSIGNED

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)

Assignee: kberezina → nobody
Status: ASSIGNED → NEW
See Also: → 1527627

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.

See Also: → 1921146
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: