Skip to content

Commit 3579504

Browse files
committed
Merge pull request #287 from airodactyl/passthrough-only-on-insert
Add option for controlling passthrough to webpages
2 parents f9f7a21 + 25ae33a commit 3579504

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
@@ -1147,6 +1147,9 @@ const Events = Module("events", {
11471147
return;
11481148
}
11491149

1150+
if (!options['passthrough'])
1151+
event.stopPropagation();
1152+
11501153
// liberator.echo ("key: " + key + "\nkeycode: " + event.keyCode + "\nchar: " + event.charCode + "\ntype: " + event.type + "\nwhich: " + event.which);
11511154
},
11521155

common/content/tabs.js

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

1133+
options.add(["passthrough"],
1134+
"Define if keypresses are passed to webpages outside of Insert mode",
1135+
"boolean", false);
1136+
11331137
options.add(["popups", "pps"],
11341138
"Where to show requested popup windows",
11351139
"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
@@ -7,6 +7,9 @@
77
browser.tabs.closeWindowWithLastTab, which means those who are used to :tabclose never closing
88
the window when closing the last tab, should set this option to false (either through about:config
99
or with :set! browser.tabs.closeWindowWithLastTab=false)
10+
* Added setting for controlling if keypresses are passed to webpages when
11+
outside of Insert/Passthrough modes (to revert to old setting,
12+
:set passthrough=true)
1013
* gr toggles Reader View
1114
* Autohide statusbar: When entering fullscreen mode, the statusbar is
1215
hidden and temporarily showed up with command inputs. Also, Users can

0 commit comments

Comments
 (0)