134

Since today, with Firefox, I cannot paste text into the text input field of whatsapp.web (the PC version of WhatsApp) anymore.

the version is FF 116.0.2 (64-bit) on Windows 10, previous versions of FF worked obviously well...

No problem on Chromium-based browser (like Chrome or Brave).

Others reported this issue.

What is happening here? Is there a Firefox workaround, or will I need to stick to Chrome?

Vickel
  • 1,089
  • 2
  • 7
  • 11
  • 1
    What OS? What Firefox version? Are you using a clipboard manager? – DrMoishe Pippik Aug 17 '23 at 22:11
  • 1
    @DrMoishePippik no clipboard manager, just Ctrl C+Ctrl V. I've added the FF version and OS – Vickel Aug 17 '23 at 22:19
  • @DrMoishePippik Here PopOS 22.04, Firefox 116.0, without using clipboard manager. Copy/paste works fine if the text comes from the chat textarea itself. – Pablo A Aug 17 '23 at 22:19
  • Still in FF 105.0.1 (64-bit) but I cannot paste any text from outside of Whatsapp Web. – TheArKa Aug 18 '23 at 06:36
  • 8
    The fix is on the way https://webcompat.com/issues/125920 – KWriter Aug 18 '23 at 06:55
  • 5
    Here's a link to the github issue that @KWriter linked to on webcompat.com: https://github.com/webcompat/web-bugs/issues/125920 – mhdadk Aug 18 '23 at 12:53
  • It does seem to be Windows-specific (@PabloA) - I'm on XUbuntu 20.04, using FF 116.0.2 – Chris H Aug 18 '23 at 15:11
  • 1
    The reference to the git/webcompat issue along with a summary of the conversation in those threads (which have come to resolution, soon to be implemented) should be posted as an answer, not just a comment. @KWriter and mhdadk – davidparks21 Aug 18 '23 at 15:18
  • i have same issue on ubuntu 20.04 with firefox. – Devang Hingu Aug 18 '23 at 16:31

6 Answers6

74

Update: Seems to be fixed on WhatsApp 2.23.35.6.


It's a bug on WhatsApp, seems to affect all platforms, and a fix is on the way (here on webcompat).

Workaround

I found this workaround, using this old trick (also here; this didn't work): set

about:configdom.event.clipboardevents.enabled to false.

screenshot of a Firefox about:config value

Copy/paste works fine if the text comes from the chat/site itself.

Side effects

With dom.event.clipboardevents.enabled turned false you can paste texts, but you won't be able to do things like paste in Google Docs or paste images, e.g. here:

screenshot of a Stack Exchange image attachment dialog

Working privacy-oriented alternatives

Meanwhile, we could use Brave instead of Chrome. It's also Chromium-based (if works on Chorme, will work on Brave), respect your privacy, and have a lot of nice features. If for some reason you don't like Brave, you could try Ungoogled Chromium.

Also, maybe it is time to move to Telegram or (even better) Signal.

Pablo A
  • 1,470
  • 13
  • 21
  • well, that obviously works also for whatsapp input (or any input field I suppose) but it is just a workaround not a solution. It is surely safer to stick to Chrome, isn't it? because of: *Warning! Setting the preference dom.event.clipboardevents.enabled to false in the Firefox Configuration Editor (about:config page) can cause problems pasting on other sites, such as strange glitches with the Facebook comment box or frustrating silent failures.* Anyway thanks for pointing it out – Vickel Aug 17 '23 at 22:40
  • 3
    Yes, it's just a workaround. Hopefully will be fixed soon. I would never use Chrome. [Brave](https://www.privacyguides.org/en/desktop-browsers/#brave) always work like Chrome, respect your privacy and have [a lot of other nice features](https://www.makeuseof.com/reasons-brave-browser-becoming-popular/) – Pablo A Aug 17 '23 at 22:48
  • Please add to your answer: *Copy/paste works fine if the text comes from the chat textarea itself*: that is the real workaround without needing to change **about:config** – Vickel Aug 17 '23 at 22:51
  • 3
    Added, but that doesn't even is a workaround. I usually paste text from other places. – Pablo A Aug 17 '23 at 23:04
  • 1
    yeah, I got carried away... – Vickel Aug 17 '23 at 23:12
  • you are correct! this is important feature but now limited to do – toha Aug 17 '23 at 23:23
  • 3
    @Vickel using chrome? eww Firefox is much better – wlf Aug 18 '23 at 09:11
  • Note: you need to disable the workaround to paste images in WhatsApp web. Only text pasting needs the workaround. The post kind of says so, but not explicitly for WhatsApp web – Sigmatics Aug 20 '23 at 13:51
  • nice this fixed my issue – Venkat.R Aug 20 '23 at 14:53
  • It is worked for WhatsApp but it broke browser's paste feature. – Mert S. Kaplan Aug 23 '23 at 09:58
23

UPDATE: This issue appears to be resolved (at least for me) on 2023-08-29 (earliest I noticed)

I worked around it with the ViolentMonkey (browser extension) script below.

As it is only a workaround, you should disable once resolved. Track it here:

https://github.com/webcompat/web-bugs/issues/125920

https://webcompat.com/issues/125920

This works great but - as with all the other workarounds/answers that circumvent the WhatsApp web code - it cannot properly handle multiple paragraphs with blank lines between them.

Here's what I have for now, until WhatsApp fixes it:

// ==UserScript==
// @name           Fix whatsapp firefox paste
// @version        1.0
// @namespace      PlaceboZA
// @author         PlaceboZA
// @description    Fixes paste function on whatsapp for Firefox
// @include        https://web.whatsapp.com/*
// @include        http://web.whatsapp.com/*
// ==/UserScript==

function handlePaste(e) {
  var data = (e.originalEvent || e).clipboardData.getData('text/plain');
  if ((data || '') !== '') {
    e.stopPropagation();
  }
}

addEventListener('paste', handlePaste, true);

EDIT: Fixed it so that image paste works. EDIT2: Added information about multiple paragraphs/line breaks in text.

PlaceboZA
  • 331
  • 5
  • 1
    Thanks! This also works if you paste the code into the browser console. (refresh will remove it) – barro32 Aug 18 '23 at 13:43
  • Sadly there is one side effect - if you paste multiple paragraphs of text (i.e. multiple newlines between texts) in one paste operation, it will take out the line breaks. In other words, if you paste `Test1 Test2` (obv. replace with carriage return), WhatsApp will end up with `Test1Test2`. I suspect the other answer involving changing the options will have the same problem. (Thanks to Mike Turchinovich for identifying this) – PlaceboZA Aug 18 '23 at 13:59
11

As a workaround, if you are on linux, you can do sh -c 'sleep 0.5; xdotool type "$(xclip -o -selection clipboard)"' which makes xdotool to type clipboard selection on the field.

MonkeyKing
  • 111
  • 2
7

Another workaround is to inject the text to be pasted into the HTML document via the DOM inspector inside an element, for example a SPAN element of one of the texts previously typed in the chat, then select it in the rendered page before pasting it.

A little annoying, but avoids using another program or touching the browser configuration.

Amessihel
  • 355
  • 1
  • 11
  • 1
    I did this by typing some text in the message box, then, using the inspector, edited the text and pasted what I wanted. E.g. I typed `asdf` and then edited: `asdf` – Peter Wood Aug 18 '23 at 22:11
  • @PeterWood, you can do that but if your text add some markdown symbols you should then cut and repast it into the message box to let WhatsApp Web format it (been there, done that :)). – Amessihel Aug 18 '23 at 23:17
4

Update for the below paragraph: it's fixed now in WhatsApp web.

This should get fixed within next WhatApp release/deploy according to this dev comment and it's an issue of WhatApp's DataTransfer wrapper.

Another workaround for now is to download and use the Firefox Extended Support Release (ESR) version instead of the regular one - the bug isn't present in that as it's on 102.14.0 and it started occursing with recent 16.0.3. Which isn't of course a great solution for e.g. web devs who need more recent versions.

Destroy666
  • 5,299
  • 7
  • 16
  • 35
1

For workarounds, see the other answers. For a fix, upgrade:

With the deployment of the latest whatsapp 2.23.35.6 and FF 116.0.3 (64-bit) the bug is now fixed and copy paste from an outside resource works normally again on web.whatsapp.com

  • webcompat locked as resolved and limited conversation to collaborators

  • denschub modified the milestones: sitewait, fixed

Vickel
  • 1,089
  • 2
  • 7
  • 11