File tree 1 file changed +25
-2
lines changed
1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ const buildMenuTpl = (props, suggestions) => {
27
27
const hasText = textSelection . length > 0 ;
28
28
const can = type => editFlags [ `can${ type } ` ] && hasText ;
29
29
30
+ const canGoBack = webContents . canGoBack ( ) ;
31
+ const canGoForward = webContents . canGoForward ( ) ;
32
+
30
33
let menuTpl = [
31
34
{
32
35
type : 'separator' ,
@@ -165,6 +168,28 @@ const buildMenuTpl = (props, suggestions) => {
165
168
} ) ) ;
166
169
}
167
170
171
+ if ( canGoBack || canGoForward ) {
172
+ menuTpl . push ( {
173
+ type : 'separator' ,
174
+ } , {
175
+ id : 'goBack' ,
176
+ label : 'Go Back' ,
177
+ enabled : canGoBack ,
178
+ click ( ) {
179
+ webContents . goBack ( ) ;
180
+ } ,
181
+ } , {
182
+ id : 'goForward' ,
183
+ label : 'Go Forward' ,
184
+ enabled : canGoForward ,
185
+ click ( ) {
186
+ webContents . goForward ( ) ;
187
+ } ,
188
+ } , {
189
+ type : 'separator' ,
190
+ } ) ;
191
+ }
192
+
168
193
if ( isDevMode ) {
169
194
menuTpl . push ( {
170
195
type : 'separator' ,
@@ -174,8 +199,6 @@ const buildMenuTpl = (props, suggestions) => {
174
199
click ( ) {
175
200
webContents . inspectElement ( props . x , props . y ) ;
176
201
} ,
177
- } , {
178
- type : 'separator' ,
179
202
} ) ;
180
203
}
181
204
You can’t perform that action at this time.
0 commit comments