Menu

GM_setClipboard

mmartz

Description

This API method allows user script authors to copy text or html to the local clipboard.

| Examples | Notes

Syntax

GM_setClipboard( data, type )

Value: Function
Returns: undefined
Compatibility: Greasemonkey 1.10.0 - 3.12.0
Access: @grant

Parameters

Properties
data type
  • All properties are optional except data.

Properties


data

Value: String
Usage: data = "Some data";

  • The data to transfer to the local clipboard

type

Value: String
Usage: type = "text";
Default: "text";

Examples

Core

GM_setClipboard("foo bar");

GM_setClipboard("Greasemonkey", "html");

Notes


Related

Wiki: Greasemonkey_Manual:API