File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,28 @@ export class BoxHeroWindow extends ViteWindow {
229
229
230
230
if ( ! this . webviewContents ) return ;
231
231
232
+ this . removeAllListeners ( "app-command" ) . on ( "app-command" , ( e , cmd ) => {
233
+ if ( cmd === "browser-backward" && this . webviewContents ?. canGoBack ( ) ) {
234
+ this . webviewContents . goBack ( ) ;
235
+ } else if (
236
+ cmd === "browser-forward" &&
237
+ this . webviewContents ?. canGoForward ( )
238
+ ) {
239
+ this . webviewContents . goForward ( ) ;
240
+ }
241
+ } ) ;
242
+
243
+ this . removeAllListeners ( "swipe" ) . on ( "swipe" , ( e , direction ) => {
244
+ if ( direction === "left" && this . webviewContents ?. canGoBack ( ) ) {
245
+ this . webviewContents . goBack ( ) ;
246
+ } else if (
247
+ direction === "right" &&
248
+ this . webviewContents ?. canGoForward ( )
249
+ ) {
250
+ this . webviewContents . goForward ( ) ;
251
+ }
252
+ } ) ;
253
+
232
254
this . webviewContents
233
255
. removeAllListeners ( "did-create-window" )
234
256
. on ( "did-create-window" , ( window , detail ) => {
You can’t perform that action at this time.
0 commit comments