Bug 227671 - "Copy message link" option doesn't work in Discord web version
Summary: "Copy message link" option doesn't work in Discord web version
Status: RESOLVED DUPLICATE of bug 223775
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 14
Hardware: Mac (Apple Silicon) macOS 11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-07-04 04:18 PDT by Kostya
Modified: 2021-07-05 08:51 PDT (History)
6 users (show)

See Also:


Attachments
screen recording of the issue (15.34 MB, video/quicktime)
2021-07-04 04:18 PDT, Kostya
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kostya 2021-07-04 04:18:58 PDT
Created attachment 432860 [details]
screen recording of the issue

Safari Version 14.1.1 (16611.2.7.1.4)

1. Open web version of Discord
2. Find any server, join it, find any message
3. Use "copy message link" option on any message



What happens

1. Link to the messsage (url) doesn't copy to clipboard



What should happen

1. Link to the message (url) copies to the clipboard
Comment 1 Kostya 2021-07-04 04:20:32 PDT
I'm not a developer, so put this bug into Evangelism component. Sorry if it's a wrong way of doing things.
Comment 2 Sam Sneddon [:gsnedders] 2021-07-04 17:29:36 PDT
This, called with a string, seems not to cause the string to be copied to the clipboard Safari 14.1.1:

function copy(e) {
        var t = document.body;
        if (null == t)
            throw new Error("[Utils] ClipboardUtils.copy(): assert failed: document.body != null");
        var n = document.createRange(),
            r = window.getSelection(),
            i = document.createElement("textarea");
        i.value = e,
        i.contentEditable = "true",
        i.style.visibility = "none",
        t.appendChild(i),
        n.selectNodeContents(i),
        null == r || r.removeAllRanges(),
        null == r || r.addRange(n),
        i.focus(),
        i.setSelectionRange(0, e.length);
        var o = document.execCommand("copy");
        return t.removeChild(i), o
    }
Comment 3 Radar WebKit Bug Importer 2021-07-04 17:29:50 PDT
<rdar://problem/80157571>
Comment 4 Sam Sneddon [:gsnedders] 2021-07-05 08:51:47 PDT
Oh, no, that's wrong. The function works fine (though Web Inspector console doesn't count as a user gesture, perhaps?).

Caused by having requestAnimationFrame in the stack.

*** This bug has been marked as a duplicate of bug 223775 ***