Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit ce780b0

Browse files
Remove mouse-forward-back
1 parent b7efca4 commit ce780b0

File tree

5 files changed

+12
-54
lines changed

5 files changed

+12
-54
lines changed

.travis.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,10 @@ before_install:
3333
libxext-dev \
3434
libxkbfile-dev \
3535
libxtst-dev
36-
else
37-
npm uninstall --save mouse-forward-back
38-
fi
39-
- |
40-
if [ "$TRAVIS_OS_NAME" == "windows" ]; then
41-
npm install --global windows-build-tools
4236
fi
4337
4438
script: npm test && npm run dist
4539

46-
4740
branches:
4841
only:
4942
- master

index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ electron.app.on('ready', () => {
5555
server: !(process.argv.includes('-g') || process.argv.includes('--use-global-ssb'))
5656
}, () => {
5757
const browserWindow = openMainWindow()
58+
59+
browserWindow.on('app-command', (e, cmd) => {
60+
if (cmd === 'browser-backward' && browserWindow.webContents.canGoBack()) {
61+
electron.ipcRenderer.send('goBack')
62+
}
63+
64+
if (cmd === 'browser-forward' && browserWindow.webContents.canGoForward()) {
65+
electron.ipcRenderer.send('goForward')
66+
}
67+
})
68+
5869
const menu = defaultMenu(electron.app, electron.shell)
5970

6071
menu.splice(4, 0, {

lib/main-window.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ const requireStyle = require('require-style')
1616
const ssbUri = require('ssb-uri')
1717
const pull = require('pull-stream')
1818

19-
let mouseForwardBack
20-
21-
try {
22-
mouseForwardBack = require('mouse-forward-back')
23-
} catch (err) {
24-
mouseForwardBack = false
25-
}
26-
2719
module.exports = function (config) {
2820
const sockets = combine(
2921
overrideConfig(config),
@@ -144,17 +136,6 @@ module.exports = function (config) {
144136
electron.ipcRenderer.on('goForward', views.goForward)
145137
electron.ipcRenderer.on('goBack', views.goBack)
146138

147-
if (mouseForwardBack) {
148-
mouseForwardBack.register((direction) => {
149-
if (direction === 'back') {
150-
views.goBack()
151-
} else if (direction === 'forward') {
152-
views.goForward()
153-
}
154-
},
155-
electron.remote.getCurrentWindow().getNativeWindowHandle())
156-
}
157-
158139
document.head.appendChild(
159140
h('style', {
160141
innerHTML: computed(api.settings.obs.get('patchwork.theme', 'light'), themeName => {

package-lock.json

Lines changed: 0 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@
106106
"electron-builder": "^21.2.0",
107107
"standard": "^14.3.1"
108108
},
109-
"optionalDependencies": {
110-
"mouse-forward-back": "^1.0.1"
111-
},
109+
"optionalDependencies": {},
112110
"build": {
113111
"appId": "org.ssbc.patchwork",
114112
"linux": {

0 commit comments

Comments
 (0)