From c27f5d1771666766e983424b223e2072f839ee41 Mon Sep 17 00:00:00 2001 From: James Riley Date: Fri, 18 Aug 2017 10:26:29 -0700 Subject: [PATCH] Added electron-context-menu. - This must be initialized once in the app itself, which makes the context menu work correctly in the main Rambox window. - Aside from that, each webview needs to be initialized with electron-context-menu as well. - I'm currently running a custom fork with this functionality added and everything works exactly as expected. --- app.js | 3 +++ app/package.json | 3 ++- app/ux/WebView.js | 2 ++ package.json | 3 ++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index 0013fec8..57333fec 100644 --- a/app.js +++ b/app.js @@ -15,6 +15,9 @@ Ext.application({ // auto update logic const ipc = require('electron').ipcRenderer; + +require('electron-context-menu')(); + ipc.on('showAbout', function(event, message) { !Ext.cq1('about') ? Ext.create('Rambox.view.main.About') : ''; }); diff --git a/app/package.json b/app/package.json index ec984b65..beaa66bb 100644 --- a/app/package.json +++ b/app/package.json @@ -35,6 +35,7 @@ "electron-is-dev": "^0.1.2", "mime": "^1.4.0", "rimraf": "2.6.1", - "tmp": "0.0.28" + "tmp": "0.0.28", + "electron-context-menu": "0.9.1" } } diff --git a/app/ux/WebView.js b/app/ux/WebView.js index da8c6f8b..f49ae502 100644 --- a/app/ux/WebView.js +++ b/app/ux/WebView.js @@ -229,6 +229,8 @@ Ext.define('Rambox.ux.WebView',{ var webview = me.down('component').el.dom; + require('electron-context-menu')({window: webview}); + // Google Analytics Event ga_storage._trackEvent('Services', 'load', me.type, 1, true); diff --git a/package.json b/package.json index c189e972..ad965031 100644 --- a/package.json +++ b/package.json @@ -106,6 +106,7 @@ "electron-is-dev": "^0.1.2", "mime": "^1.4.0", "rimraf": "2.6.1", - "tmp": "0.0.28" + "tmp": "0.0.28", + "electron-context-menu": "0.9.1" } }