Looking through the API docs I think that the answer to this is no, but is there any way to toggle support for Chrome commands from inside an extension?
The problem: When using global commands Chrome will hijack that hotkey so other applications that are listening for that key will never get it. For example, I have an extension that uses the media keys. Many desktop applications (itunes, etc.) use the media keys as hotkeys as well. When the extension commands are set to use the media keys globally, Chrome is the only application that receives those key presses.
There is a bug report here about this problem, but no work has been done on it yet.
From an extension perspective, the best solution with the current implementation would be a button inside the extension's browser action that could toggle Chrome listening for commands (which would in turn free up the keys that it is listening for). Is anything like this possible?
The best that I have come up with is a button inside the browser action to actually disable the extension (using management.setEnabled). The problem with this approach is that the user will then have to navigate to chrome://extensions to re-enable it - far from ideal.
I have been recommending to my users to change the hotkeys to something else if they are encountering this problem, but that is also not a great solution.
Any other suggestions?
Related
I know there are lots of javascript plugins and libraries to allow users to pick emojis for text inputs, but windows and mac already have native emoji pickers (⊞ Win. or CTRL⌘Space), Is there a way for me to open these native emoji pickers when a user clicks in a text field instead of installing plugins in my website?
I already tried emulate button key press, but it didn't work at all.
Short answer is no.
In order to access any OS feature from javascript, you need a corresponding browser API to support.
AFAIK, there isn't an API for that. There's a discussion here which suggests adding <input emoji /> to standard but seems no traction gained.
Edit: Below is my original answer, revised. Comments pointed out I was focusing on the wrong aspect of the question, I totally agree.
However, the OP obviously has some wrong idea about what you can do in javascript to leverage browser ability. So I think it's still worth clarification.
You can't send arbitrary emulated keyboard event from js and hoping the OS will respond. Were it possible, it'd be a severe security issue on browser's part. Imagine open a website and it fires a series of keyboard event to your OS and wipes out your desktop (totally feasible through shortcuts).
You need to understand the runtime env inside the browser is basically isolated from the one of native OS. Whatever OS feature that's accessible to your javascript is totally up for browser vendors to decide. For security reason, they are super careful in making these decisions.
Also, make a distinction on "what browser can do", and "what browser allows you to do in js". Seeing Chrome has an "Emoji & Symbols" context menu item, doesn't necessarily mean it decides to grant you the same ability in js.
To further clarify why the emulated keyboard event is fundamentally different from the native one, I include a graph here. The blue arrow is how emulated keyboard event flows. The farthest place it can reach is the browser's internal event bus. It never got a chance to reach the OS event bus, so no way to notify native emoji picker.
I am creating an application which supports multiple regional languages using "Google Input Tool" chrome extension.
can I switch between input languages on "onfocus()" event of an element?
I have searched on the net and come across "chrome.input.ime"
but don't know how to manage it with JavaScript
I found Extension ID "mclkkofklkfljcocdinagocijmpgbhab"
and need something to do like
chrome.runtime.sendMessage({ up: 1 });
Can anyone help?
~Manoj
chrome.input.ime allows you to implement a new input method on Chrome OS only. So it's not what you seek.
It does not seem like you can control the GIT extension from your code.
You suggest messaging the extension; however, it does not listen to any external messaging events - I have explicitly verified that. So it wouldn't work.
My friend challenged me to figure out a way to control YouTube (in Chrome) from the computer desktop (Or a program different from Chrome). Basically the idea here is to fire an event where I can handle what to do with certain hotkey combos. Chrome has an api (chrome.commands) that allows for this, but the user must be in chrome for it to fire the event (which makes sense). I would like to discuss any possible alternatives.
I know extensions can have file access to the computer (using chrome.fileSystem api), so I was thinking of having a folder somewhere that had text file(s) that would be written to by a script running on the user's computer. The script could also potentially just be a macro fired by Windows on a certain key stroke.
Is this a practical approach, or are there easier ways to accomplish this? It just seems like there's a lot of "moving" parts needed to make this work.
EDIT: Main goal here is to get skip and pause/play keys (that some keyboards have) to work with chrome. using Ctrl+Shift+[0-9] works with chrome.commands, but anyone have other suggestions to get those other keys to work?
chrome.commands has a very limited set of shortcuts that work globally:
By default, Commands are scoped to the Chrome browser, which means that while the browser does not have focus, the shortcut will be inactive. On desktop Chrome, Commands can instead have global scope, as of version 35, and will then also work while Chrome does not have focus. NOTE: The exception here is Chrome OS, where global commands are not allowed at the moment.
The user is free to designate any shortcut as global using the UI in chrome://extensions \ Keyboard Shortcuts, but the extension developer is limited to specifying only Ctrl+Shift+[0..9] as global shortcuts. This is to minimize the risk of overriding shortcuts in other applications since if, for example, Alt+P were to be allowed as global, the printing shortcut might not work in other applications.
Documentation is available here.
I'm looking for a way to record every thing I do in Chrome Devtools so I can play it back verbatim. I've seen a lot of docs on how to manipulate page content, track page performance and behavior etc from devtools extensions, but nothing yet about actually watching what I do in Chrome Devtools itself. I'd be willing to write an extension if that's what needed. The goal is a teaching tool where I can record things I'm doing in devtools and play them back. (Of course, one could use a GIF recorder but that's so 00's). Something I've looked a little bit at so far is chrome devtools protocol viewer but not sure if it could accomplish the task.
Can anybody suggest a potential way to accomplish this? Thanks in advance!
Now Chrome has an inbuilt recorder tool available in the Dev Tools. Much better than installing any 3rd party extension. Additionally, there are many more features to track the user journey.
Recorder in Chrome Dev Tools
You may try using Desktop Capture API which can be used to capture content of screen, individual windows or tabs. Here's a demo app that shows you how to use a Chrome extension to access the desktopCapture API in your web-application. Additional reference which might help: In chrome extensions, is there a way to record screen without ssl?
I'm not talking about browser exploits. I'm talking about real applications used in real companies, like Ijji and Nexon.
Basically, from their websites you can click a "Start Game" button, which will launch an executable located at c:\ijji\english or c\nexon[gamename] respectively. These applications are real desktop applications, meaning that they can take advantage of the filesystem, direct3d, and OS [in the form of executing other applications]. The applications can also be launched through command line [as opposed to going to the game host's website].
I figured this would be possible if the application created an ActiveX object to call for the creation of a new process. However, the websites are able to launch applications from multiple browsers other than Internet Explorer, including chrome, which, to my knowledge, does not implement ActiveX.
Obviously the people developing these applications use their own means to do this.
From looking at the services list as well as currently running applications list, I have no indication that they're running something like "gameLaunchingServer.exe" which listens to some obscure port for an incoming connection [to be accessed using iframe - HTTP Protocol] and responds by launching an application...
I'm stumped, and this is sort of stuck in my mind. Obviously, they're not using some random browser exploit, otherwise people at http://www.[insertMaliciousWebsiteHere].com would have jumped on the opportunity already to install random crap. Regardless, it seems pretty cool, and I wanted to know how it worked.
Just curious, hehe.
I believe what they're doing is setting up their own protocol handler on install - when a browser is asked to access an address with a protocol that it doesn't know how to handle (for instance, a steam:// address), it looks at all the installed protocol handlers to find a match.
So you can register your application as a myApplication:// protocol handler, and then your web page can link to a myApplication:// address and launch your application.
I didn't quite find the button you are talking about, but I'm thinking it works only after you installed the application once, isn't it?
In that case, the application probably created its own protocol, just as skype, msn and a bunch of clients.
Having a protocol is the easiest way (and very easy indeed to implement - a simple registry key).
Another way which is used is an extension or plugin.
I thought they were run through plug-ins or like applets.
For example, MS SilverLight