File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5681,7 +5681,25 @@ export type CRMAPIMessage = {
56815681 * @see {@link https://tampermonkey.net/documentation.php#GM_setClipboard }
56825682 * @param {any } ignoredArguments - An argument that is ignored
56835683 */
5684- GM_setClipboard : CrmAPIInstance . _helpers . emptyFn ,
5684+ GM_setClipboard ( this : CrmAPIInstance , content : string ) : void {
5685+ const element = document . createElement ( 'span' ) ;
5686+ element . innerText = content ;
5687+ document . body . appendChild ( element ) ;
5688+
5689+ const snipRange = document . createRange ( ) ;
5690+ snipRange . selectNode ( element ) ;
5691+ const selection = window . getSelection ( ) ;
5692+ selection . removeAllRanges ( ) ;
5693+ selection . addRange ( snipRange ) ;
5694+ try {
5695+ document . execCommand ( 'copy' ) ;
5696+ } catch ( e ) {
5697+ console . log ( e ) ;
5698+ }
5699+
5700+ selection . removeAllRanges ( ) ;
5701+ element . remove ( ) ;
5702+ } ,
56855703 /**
56865704 * Sends an xmlhttpRequest with given parameters
56875705 *
You can’t perform that action at this time.
0 commit comments