Greasy Fork is available in English.

Ctlr+鼠标右键复制选中内容

2020/4/27 下午4:53:47

// ==UserScript==
// @name        Ctlr+鼠标右键复制选中内容
// @namespace   Ctrl Right copy
// @match       *://*/*
// @grant       GM_setClipboard
// @grant       GM_notification
// @version     1.2
// @author      -
// @description 2020/4/27 下午4:53:47
// ==/UserScript==

document.oncontextmenu = (event) => {
  if(event.ctrlKey){
    event.preventDefault();
    const selectText = window.getSelection().toString().replace(/\n+/g, '\n\n');
    if (selectText.length) {
      GM_setClipboard(selectText);
      GM_notification({
        text: selectText,
        title: '复制到如下内容:',
        timeout: 2000,
      })
    }
  }
};