I want an extension to be controlled by the Omnibox. The chrome.omnibox API lets me register a keyword, but that means a lot of clicking or typing to get to the extension. For example, I have to Ctrl+L to select the omnibox, then type some letters for the extension and space/tab.
Can this "omnibox mode for my extension" be entered programmatically? I.e. is there an API call I can make that will take the user's keyboard focus to the omnibox in already switched mode to my extension? I just want to replace the sequence of clicks/typing with a single keyboard shortcut that will allow the user immediately interact with the extension via the omnibox.
This is not currently possible. I could see this being implemented in two ways:
1. As you suggest, by allowing the extension to enter omnibox programmatically. I'm not sure if that's a good idea - stealing keyboard focus could be annoying to the user, and a possible security risk.
2. By adding "enter omnibox mode" as a target for the commands API. That way the user can configure the keyboard shortcut or disable it entirely.
Related
I am using Gnome 3.34.3.
When I need to unlock a private key (ssh, git, etc.), a modal window appear and ask me to write the key's passphrase.
The GUI is modal and it is not convenient for me.
I would like to unlock my private keys from either the terminal or a not modal GUI.
Is it possible ?
Thank you !
echo "pinentry-program /usr/bin/pinentry-gtk" >> ~/.gnupg/gpg-agent.conf
gpg-connect-agent reloadagent /bye
Almost solved.
In short; no. [sorry]
The dialog is kept modal to mark its importance. For example, such password, urgent info windows must be kept modal to get the user's attention as soon as possible. Modal also prevents you from accessing the other part of application, which otherwise would spoil the application entirely.
For example:
if the dialog wasn't modal while getting authentication, there is no meaning at all. The dialog could be just kept down by the window manager without you even knowing it. There are possibilities.
I agree, modal windows are irksome as many crazy developers use it for everything (You can read more about this on GNOME's HIG guidelines), but a dialog should be modal when it has to be.
It depends on the developer to choose what should be modal and what should not be. That is it depends on the application, and there is no system wide settings available to change that behavior. You can, so, ask the respective developer to replace the modal windows with convenient ones.
To your question of accessing it from terminal, it also depends on the application.
Chrome Extension: I am looking for a way to assign global keyboard shortcuts that can be invoked even when the current tab has no content (and hence no content script). Some examples of such tabs: 'new tab' tabs, chrome://extensions tabs, 'page not loaded' tabs, etc Use cases for such a requirement are operations like close tab, go to next/prev tab, etc.
The chrome.commands api allows one to do this. However, there seems to be no way for the user to configure these keyboard shortcuts, which is something I'd really want my extension to allow.
Is there any way to get configurable keyboard shortcuts that don't need a content script?
The shortcut for chrome.commands cannot be changed by the extension, but it is configurable by the user. This interface is built-in and offered by Chrome itself.
Visit the extensions page, scroll down and click on the Configure commands link. A box will be shown, where the user can set the preferred shortcut:
The code for the "Remap shortcut" extension is posted in this answer.
My Chrome extension doesn't need an icon - it's a one-liner extension that doesn't want to take up space on your extension bar.
How can I hide the icon by default?
Due to a change spearheaded by Google, all extensions now must have an icon in the toolbar area or the "overflow" in the menu.
Even if you don't have a browser_action, your extension will display an icon (or failing that, a tile with extension name's first letter). If you do not declare a browser_action, it will be greyed out and non-interactive, but will still be there.
The idea of this change is to provide visibility of otherwise potentially stealthy extensions ("Hey user, did you even know you have those installed?"). It's, let's put it, debatable whether it's the best approach, but that was Google's decision.
To suppress this behavior, add "converted_from_user_script": true to the extension's manifest.json. This works as of Chrome 61.
It used to be that visiting a link to a user script (ending in .user.js) caused Chrome to package up the user script as a content script extension with a generated manifest which included the converted_from_user_script key. Of course, this no longer works because all extensions (except in developer mode) now have to come from the Chrome Web Store.
Google thought it best to make the icon mandatory and I think so too, for reasons already pointed out by Xan.
Now of course you 're right, when you say that many extensions have no need for an icon, but the requirement of one still gives your extension an identity and Google still gives the user the opportunity to remove it from the toolbar. He simply has to right click the extension's icon and then choose Hide in Chrome menu.
I know, many users don't really bother to read all of the options under right click, or even right click it at all. But most of them still will make a single left click, to see if there is any option in the fancy new extension they added. You can take advantage of this by making a simple window where you point out their option of hiding the icon.
If you don't want an icon, you can omit the browser_action parameter from your manifest.json (the default_icon option is where you usually specify the icon). The browser_action section is what controls what you see in the toolbar.
I create a program that simulates me browsing to gmail, entering the user name and password and clicking the submit button.
All this with C#.
I would appreciate two kinds of answers:
One that tells how to do this programaticaly. Since I may be interested in automating more
sophisticated user activities.
On that tells me about a program that already does that.
Thanks!!
I want to access my mail account with a double click (without browsing, entering username and password and pressing submit).
Why not check the 'stay signed in' box, and add a bookmark toolbar item for Gmail?
alt text http://img192.imageshack.us/img192/6240/picture5zw.png
Do it once, and all future logins are a one-click process. Am I missing something? Why overcomplicate this with a C# program?
Well, depending on the browser you're using, it might be much simpler to use a greasemonkey userscript (on FireFox) that does auto-login for you.
If you want to simulate user activity take a look at AutoHotKey.
Also if the issue is specific to logging into websites take a look at LastPass. They have plug-ins for every major browser and mobile device. I haven't type out a user name or password on a website in months.
If your ok with clicking 'go' (or wharever) on your application and then clickingin the username field. Look into Sendkeys:
Put this in the onClick event of a button and replace text with your user details:
SendKeys.Send("USER#DOMAIN.COM{TAB}PASS{TAB}{TAB}{ENTER}");
You might also want to put a timer or make your program wait a few seconds before actually sending the keys to give you time to click in the username box.
Use WatIn. and this is a placeholder to get to 30 Chars answer
My problem is very simple, but implementation can be hard!
I want that my application (Windows Application:: Visual C# .net) is launched whenever the user uses some keys combinations (on his keyboard).
For example it types Ctrl+W+W and my application is launched, that's all, I want the simplest implementation, less code, memory...
Thanks :D
You would need to write a keylogger type application in conjunction with your app which monitors for keyboard events. Once your specific shortcut is triggered you could then load your application.
See here for information on how to capture keystrokes.
Create a shortcut to the application, and assign a hot-key combination to the shortcut. Depending on the O/S, not every keystroke combination can be assigned to a shortcut, e.g. you may be able to assign Ctrl+Alt+W but not Ctrl+W+W.
On Windows, you can create a shortcut (on the desktop) to your application.
When you open the properties of the shortcut, on the second tab (labeled "Shortcut"), you can assign a shortcut key. But you can use only Ctrl+Alt+key shortcuts.
I don't think this is possible in the way that you framed this question. What is possible, however, is to have your application run automatically on startup without showing any forms, have it hook into Windows to monitor all keystrokes (I'm not sure how to do that part, exactly) and then show a form when the user presses a particular sequence of keys.
So in other words, your application would have to be running from the time Windows starts, but only show itself (make a form visible) when the user clicks a particular key sequence.
Update: here is a link to an article that discusses how to do global keystroke capture using C#: http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx.