224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
|
catch (e) {
showError(e);
}
},
sendTextToClipboard (sText) {
// recipe from https://github.com/mdn/webextensions-examples/blob/master/context-menu-copy-link-with-types/clipboard-helper.js
// It doesn’t seem to work anymore
//console.log(sText);
function setClipboardData (xEvent) {
document.removeEventListener("copy", setClipboardData, true);
xEvent.stopImmediatePropagation();
xEvent.preventDefault();
xEvent.clipboardData.setData("text/plain", sText);
}
|
|
|
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
|
catch (e) {
showError(e);
}
},
sendTextToClipboard (sText) {
// recipe from https://github.com/mdn/webextensions-examples/blob/master/context-menu-copy-link-with-types/clipboard-helper.js
// It doesn’t seem to work anymore on Firefox. Still OK on Chrome.
//console.log(sText);
function setClipboardData (xEvent) {
document.removeEventListener("copy", setClipboardData, true);
xEvent.stopImmediatePropagation();
xEvent.preventDefault();
xEvent.clipboardData.setData("text/plain", sText);
}
|