> Description of problem: Using UI (Admin or Dev), on Builds > BuildConfigs, if you click on "Copy URL with Secret" (Generic or Github) nothing happens. If you open browser console, you see "uncaught exception: undefined". > Version-Release number of selected component (if applicable): 4.2.7 > How reproducible: Easily. > Steps to Reproduce: 1. Create a BuildConfi using catalog example 2. Open Builds > BuildConfig and then the bc created 3. Click on "Copy URL with Secret" for Github > Actual results: Nothing happens (error on console) > Expected results: Get webhook link copied to clipboard.
After some tests, I found out that this problem happens on Mozilla Firefox (70.0.1) but not on Google Chrome (78.0.3904.87). So maybe there is something happening at JavaScript level which is not supported in all browsers.
I suspect we don't have permission to write to the clipboard since we try to do it in response to the XHR: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText#Browser_compatibility > Writing to the clipboard is available without permission in secure contexts and browser extensions, but only from user-initiated event callbacks. Even though we're responding to a click, the XHR for the secret takes us out of that context.
*** Bug 1781300 has been marked as a duplicate of this bug. ***
https://github.com/openshift/console/pull/3733
1. Create a BuildConfig using catalog example 2. Open Builds > BuildConfig and then the bc created 3. Click on "Copy URL with Secret" for Github or Generic, no errors and content can be copied successfully Verified on 4.4.0-0.nightly-2019-12-16-124946
Verified on FF68(reproduced the issue on older builds) & FF71
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:0581