Copy to clipboard button copies a JSON object instead of the branch name in Firefox

Summary

When using the clipboard button to copy a branch name in the merge request widget or the file path in the Changes tab, it copies a JSON object instead of the branch/path name.

Browser: Firefox 55.0. Could not reproduce in Chrome.

Steps to reproduce

  1. Go to an MR https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13934

  2. Click the copy to clipboard button for the branch name in the merge request widget

  3. Pasting gives:

    {"text":"docs/migrating-from-tfs","gfm":"`docs/migrating-from-tfs`"}

Example Project

Any MR, for example https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13934

Edited by Achilleas Pipinellis