The Solutions:
Solution 1: Check Chrome Browser Version
The issue is most likely caused by a bug in Chrome version 112.x. The solution is to update Chrome to version 113.0.5672.63 or later. This update has fixed the bug and copying and pasting from the Console panel in DevTools should now work as expected.
Solution 2: Select preceding characters
To resolve the issue with copying text from error logs, you need to select the text along with two preceding characters. This is because there is an offset of -2 when copying from error logs.
For example, if you want to copy the text "bli" from "bla bli blu", you should select "a bli". This will ensure that the correct text is copied and pasted without any shifts.
Solution 3: On Chrome Canary, 115.0.5749.0, this issue seems to have been fixed
On Chrome Canary, version 115.0.5749.0, the issue of text shifting 2 characters backwards when copying and pasting from the Console panel in DevTools has been resolved. This fix is currently available in the Canary version of Chrome, and it is expected to be included in a future stable release of Chrome.
Q&A
Describe the bug
When copying text from the Console panel in DevTools. After selecting a word and copying it, when I paste it, it always shifts 2 characters backwards.
What’s causing the issue?
It’s a Chrome bug, which has been fixed in version 113.0.5672.63
Why is the text shifting?
There is -2 character translation in the selection.
Video Explanation:
The following video, titled "Copy text in chrome DevTools/Console panel not work normally ...", provides additional insights and in-depth exploration related to the topics discussed in this post.
最近在使用Chrome(112.0.5615.49)在macOS(12.6.3)上,发现从DevTools的Console面板上进行复制粘贴的时候出现问题,选中的单词复制后,进行粘贴, ...
The following video, titled "Copy text in chrome DevTools/Console panel not work normally ...", provides additional insights and in-depth exploration related to the topics discussed in this post.
最近在使用Chrome(112.0.5615.49)在macOS(12.6.3)上,发现从DevTools的Console面板上进行复制粘贴的时候出现问题,选中的单词复制后,进行粘贴, ...