const remote = require('electron').remote;
const Menu = remote.Menu;
const MenuItem = remote.MenuItem;

module.exports = {
    build: function(target) {
        var template = [
            {
                label: 'Copy Link Address',
                role: 'copy'
            }
        ];

        if (process.platform == 'darwin') {
            template = [...template,
                {
                    type: 'separator'
                },
                {
                    label: 'Services',
                    role: 'services',
                    submenu: []
                }
            ];
        }
        return Menu.buildFromTemplate(template);
    }
};

const remote = require('electron').remote;
const clipboard = require('electron').clipboard;
const Menu = remote.Menu;
const MenuItem = remote.MenuItem;

module.exports = {
    build: function(target) {
        var template = [
            {
                label: 'Copy Link Address',
                click: function (e, focusedWindow) {
                  clipboard.writeText(target.href);
                }
            }
        ];

        if (process.platform == 'darwin') {
            template = [...template,
                {
                    type: 'separator'
                },
                {
                    label: 'Services',
                    role: 'services',
                    submenu: []
                }
            ];
        }
        return Menu.buildFromTemplate(template);
    }
};

Copy role doesn't work, need to manually copy the link target
Copy role doesn't work, need to manually copy the link target
