diff --git a/app/index.html b/app/index.html index 9c2a751..d582c01 100644 --- a/app/index.html +++ b/app/index.html @@ -4,7 +4,7 @@ Nagome - + diff --git a/app/renderer.js b/app/renderer.js index 95391dc..4b6071e 100644 --- a/app/renderer.js +++ b/app/renderer.js @@ -1,6 +1,4 @@ const ipc = require('electron').ipcRenderer; -const {remote} = require('electron'); -const {Menu} = remote; window.onload = function() { const webview = document.getElementById('webview'); @@ -17,20 +15,4 @@ window.onload = function() { event.preventDefault(); ipc.send('new-window', e.url); }); - - // Context menu - const template = [ - { label: 'Undo', accelerator: 'CmdOrCtrl+Z', role: 'undo' }, - { label: 'Redo', accelerator: 'Shift+CmdOrCtrl+Z', role: 'redo' }, - { type: 'separator' }, - { label: 'Cut', accelerator: 'CmdOrCtrl+X', role: 'cut' }, - { label: 'Copy', accelerator: 'CmdOrCtrl+C', role: 'copy' }, - { label: 'Paste', accelerator: 'CmdOrCtrl+V', role: 'paste' }, - { label: 'Select All', accelerator: 'CmdOrCtrl+A', role: 'selectall' } - ]; - const menu = Menu.buildFromTemplate(template); - window.addEventListener('contextmenu', (e) => { - e.preventDefault(); - menu.popup(remote.getCurrentWindow()); - }, false); } diff --git a/app/browserwindow.js b/app/webview.js similarity index 68% rename from app/browserwindow.js rename to app/webview.js index 120ada7..7fca11c 100644 --- a/app/browserwindow.js +++ b/app/webview.js @@ -1,18 +1,7 @@ -const ipc = require('electron').ipcRenderer; const {remote} = require('electron'); -const {Menu, MenuItem} = remote; +const {Menu} = remote; window.onload = function() { - window.addEventListener('page-title-updated', (e) => { - console.log("page-title-updated: view"); - document.title = e.title; - }); - - window.addEventListener('new-window', (e) => { - event.preventDefault(); - ipc.send('new-window', e.url); - }); - // Context menu const template = [ { label: 'Undo', accelerator: 'CmdOrCtrl+Z', role: 'undo' }, @@ -28,4 +17,4 @@ window.onload = function() { e.preventDefault(); menu.popup(remote.getCurrentWindow()); }, false); -}; +}