darwinShare TM
This commit is contained in:
parent
7395086bea
commit
6363375361
3 changed files with 31 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
import {join} from "path";
|
||||
import {app, BrowserWindow as bw, ipcMain, shell} from "electron";
|
||||
import {app, BrowserWindow as bw, ipcMain, shell, ShareMenu} from "electron";
|
||||
import * as windowStateKeeper from "electron-window-state";
|
||||
import * as express from "express";
|
||||
import * as getPort from "get-port";
|
||||
|
@ -534,6 +534,25 @@ export class BrowserWindow {
|
|||
await linux_autoUpdater.checkForUpdatesAndNotify()
|
||||
})
|
||||
|
||||
ipcMain.on('share-menu', async (_event, url) => {
|
||||
if ( process.platform != 'darwin') return;
|
||||
//https://www.electronjs.org/docs/latest/api/share-menu
|
||||
console.log('[Share Sheet - App.ts]', url)
|
||||
const options = {
|
||||
title: 'Share',
|
||||
urls: [url]
|
||||
};
|
||||
// @ts-ignore
|
||||
const shareMenu = new ShareMenu(options);
|
||||
shareMenu.popup();
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* *********************************************************************************************
|
||||
* Window Events
|
||||
* **********************************************************************************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue