File tree 4 files changed +23
-2
lines changed
4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -514,6 +514,7 @@ impl App {
514
514
Hover => self . hover ( ) ,
515
515
Insert => self . go_in_insert_mode ( ) ,
516
516
Inspector => self . webview . emit ( ShowInspector ) ,
517
+ KillWin => self . close_webview ( ) ,
517
518
Mark ( ref mark) => self . add_mark ( mark) ,
518
519
Normal => self . go_in_normal_mode ( ) ,
519
520
Open ( ref url) => self . open ( url) ,
Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ pub enum AppCommand {
72
72
Insert ,
73
73
#[ help( text="Open the web inspector" ) ]
74
74
Inspector ,
75
+ #[ help( text="Kill the webview without confirmation" ) ]
76
+ KillWin ,
75
77
#[ completion( hidden) ]
76
78
Mark ( String ) ,
77
79
#[ completion( hidden) ]
Original file line number Diff line number Diff line change 20
20
*/
21
21
22
22
/*
23
+ * TODO: rename the quit command to close.
24
+ * TODO: add a close-all command?
25
+ *
23
26
* TODO: automatically add new settings in the config files (kind of insertion sort, splitted by
24
27
* the command?).
25
28
*
48
51
*
49
52
* TODO: might not require the syntax with (relm) if we emit the signal normally.
50
53
*
51
- * TODO: add a kill command to close a webview without try_close().
52
- *
53
54
* TODO: remove dependencies like tokio.
54
55
*
55
56
* FIXME: windows opened by JavaScript cannot be claused: probably need to set the settings
Original file line number Diff line number Diff line change
1
+ < html >
2
+ < body >
3
+ < button id ="block "> Block</ button >
4
+
5
+ < script >
6
+ let button = document . querySelector ( "#block" ) ;
7
+ button . addEventListener ( "click" , function ( ) {
8
+ while ( true ) {
9
+ }
10
+ } , false ) ;
11
+
12
+ window . onbeforeunload = function ( ) {
13
+ return 'Are you sure you want to leave?' ;
14
+ } ;
15
+ </ script >
16
+ </ body >
17
+ </ html >
You can’t perform that action at this time.
0 commit comments