aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--background_scripts/settings.coffee2
-rw-r--r--content_scripts/vimium_frontend.coffee15
-rw-r--r--pages/options.coffee1
-rw-r--r--pages/options.html34
4 files changed, 45 insertions, 7 deletions
diff --git a/background_scripts/settings.coffee b/background_scripts/settings.coffee
index 3528e8a9..50a6a9f4 100644
--- a/background_scripts/settings.coffee
+++ b/background_scripts/settings.coffee
@@ -114,6 +114,8 @@ root.Settings = Settings =
searchEngines: "w: http://www.wikipedia.org/w/index.php?title=Special:Search&search=%s wikipedia"
newTabUrl: "chrome://newtab"
grabBackFocus: false
+ # Vimium Labs settings
+ vomnibarInTopFrame: false
settingsVersion: Utils.getCurrentVersion()
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 81e0e3b2..95c508ef 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -44,7 +44,7 @@ settings =
loadedValues: 0
valuesToLoad: [ "scrollStepSize", "linkHintCharacters", "linkHintNumbers", "filterLinkHints", "hideHud",
"previousPatterns", "nextPatterns", "regexFindMode", "userDefinedLinkHintCss",
- "helpDialog_showAdvancedCommands", "smoothScroll", "grabBackFocus" ]
+ "helpDialog_showAdvancedCommands", "smoothScroll", "grabBackFocus", "vomnibarInTopFrame" ]
isLoaded: false
eventListeners: {}
@@ -254,7 +254,7 @@ initializeOnDomReady = ->
# Tell the background page we're in the dom ready state.
chrome.runtime.connect({ name: "domReady" })
CursorHider.init()
- Vomnibar.init() if DomUtils.isTopFrame()
+ Vomnibar.init() # if DomUtils.isTopFrame()
registerFrame = ->
# Don't register frameset containers; focusing them is no use.
@@ -273,11 +273,12 @@ unregisterFrame = ->
executePageCommand = (request) ->
# Vomnibar commands are handled in the tab's main/top frame.
if request.command.split(".")[0] == "Vomnibar"
- if DomUtils.isTopFrame()
- # We pass the frameId from request. That's the frame which originated the request, so that's the frame
- # which should receive the focus when the vomnibar closes.
- Utils.invokeCommandString request.command, [ request.frameId ]
- refreshCompletionKeys request
+ if (DomUtils.isTopFrame() and settings.get "vomnibarInTopFrame") or
+ (frameId == request.frameId and not settings.get "vomnibarInTopFrame")
+ # We pass the frameId from request. That's the frame which originated the request, so that's the frame
+ # which should receive the focus when the vomnibar closes.
+ Utils.invokeCommandString request.command, [ request.frameId ]
+ refreshCompletionKeys request
return
# All other commands are handled in their frame.
diff --git a/pages/options.coffee b/pages/options.coffee
index d2950348..55b5b63a 100644
--- a/pages/options.coffee
+++ b/pages/options.coffee
@@ -261,6 +261,7 @@ initOptionsPage = ->
searchEngines: TextOption
searchUrl: NonEmptyTextOption
userDefinedLinkHintCss: TextOption
+ vomnibarInTopFrame: CheckBoxOption
# Populate options. The constructor adds each new object to "Option.all".
for name, type of options
diff --git a/pages/options.html b/pages/options.html
index f89ddcbb..19298189 100644
--- a/pages/options.html
+++ b/pages/options.html
@@ -71,6 +71,11 @@ b: http://b.com/?q=%s description
</tr>
<tbody id='advancedOptions'>
<tr>
+ <td colspan="3">
+ <header>Advanced Options</header>
+ </td>
+ </tr>
+ <tr>
<td class="caption">Scroll step size</td>
<td>
<div class="help">
@@ -233,6 +238,35 @@ b: http://b.com/?q=%s description
<div class="nonEmptyTextOption">
</td>
</tr>
+ <tr>
+ <td colspan="3">
+ <header>Vimium Labs</header>
+ <p>
+ These features are awesome! However, they're also not yet fully baked. They might
+ not always work, may be subject to substantial change in a future release, and could even be
+ withdrawn entirely.
+ </p>
+
+ <p>
+ Please provide feedback or suggestions on
+ <a href="https://github.com/philc/vimium/issues" target="_blank">github</a>.
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td class="caption">Experiments</td>
+ <td verticalAlign="top" class="booleanOption">
+ <div class="help">
+ <div class="example">
+ On pages with multiple frames, always open a full-size vomnibar in the tab's main frame.
+ </div>
+ </div>
+ <label>
+ <input id="vomnibarInTopFrame" type="checkbox"/>
+ Open vomnibar in top frame
+ </label>
+ </td>
+ </tr>
</tbody>
</table>
</div>