Skip to content

Commit 956c35d

Browse files
committed
Add option for controlling passthrough to webpages
1 parent ba7d8e7 commit 956c35d

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

common/content/events.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,9 @@ const Events = Module("events", {
11411141
return;
11421142
}
11431143

1144+
if (!options['passthrough'])
1145+
event.stopPropagation();
1146+
11441147
// liberator.echo ("key: " + key + "\nkeycode: " + event.keyCode + "\nchar: " + event.charCode + "\ntype: " + event.type + "\nwhich: " + event.which);
11451148
},
11461149

common/content/tabs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,10 @@ const Tabs = Module("tabs", {
11291129
]
11301130
});
11311131

1132+
options.add(["passthrough"],
1133+
"Define if keypresses are passed to webpages outside of Insert mode",
1134+
"boolean", false);
1135+
11321136
options.add(["popups", "pps"],
11331137
"Where to show requested popup windows",
11341138
"stringlist", "tab",

common/locale/en-US/options.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,17 @@
893893
</item>
894894

895895

896+
<item>
897+
<tags>'nopassthrough' 'passthrough'</tags>
898+
<spec>'passthrough'</spec>
899+
<type>boolean</type>
900+
<default>off</default>
901+
<description>
902+
<p>Define if keypresses are passed to webpages if you are not in Insert mode.</p>
903+
</description>
904+
</item>
905+
906+
896907
<item>
897908
<tags>'pps' 'popups'</tags>
898909
<spec>'popups' 'pps'</spec>

vimperator/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
browser.tabs.closeWindowWithLastTab, which means those who are used to :tabclose never closing
66
the window when closing the last tab, should set this option to false (either through about:config
77
or with :set! browser.tabs.closeWindowWithLastTab=false)
8+
* Added setting for controlling if keypresses are passed to webpages when
9+
outside of Insert/Passthrough modes (to revert to old setting,
10+
:set passthrough=true)
811

912
2015-08-25:
1013
* Version 3.10.1

0 commit comments

Comments
 (0)