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.
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?
For a website project, I've gotten a customer request to build in a keyboard shortcut for a specific action (show total budget). I thought about what would be the best choice for a shortcut to work on all platforms/browsers and initially chose Alt+Shift+B, but noticed after a while that that combination seems to be a shortcut to open a menu action in Firefox (on Windows).
So the question is, is there a list of keyboard shortcuts which are likely to work on all platforms, not interfere with system or browser shortcuts, and don't generate output (i.e. in <input> tags)?
Note: Of course I can't avoid all failure cases, like other applications globally registering and "catching" the shortcut I want to use; this is intended to work on the average system (Mac/Windows/Linux & Chrome/Firefox/IE/Safari/Opera).
Is there a way to use Javascript within a browser environment to detect global keystrokes and mouse movements (i.e. all keystrokes and clicks within and outside the browser)? I understand this might involve browser plugins, but would like advice on specific pieces of technology I can look into.
No, this is not possible and that's a damn good thing. We don't need random websites to act as keyloggers.
Any browser plugin allowing a website to do that would actually be malware or at least open a gaping security hole and thus end up on the plugin blacklists of browser vendors really soon.
I like to keep javascript debugging enabled in my browser so when I'm developing my own code I can instantly see when I've made an error.
Of course this means I see errors on apple.com, microsoft.com, stackoverflow.com, cnn.com, facebook.com. Its quite fun sometimes to see just how much awful code there is out there being run by major sites but sometimes it gets really annoyed.
I've wondered for YEARS how to change this but never really got around to it. Its particularly annoying today and I'd really like to know of any solutions.
The only solution I have is : use a different browser for everyday browsing.
I'm hopin theres some quick and easy plugin someone can direct me to where I can toggle it on and off based upon the domain i'm on.
Edit: I generally use IE7 for everyday browsing
Firebug lets you enable/disable debugging for different domains.
Script Debugging in IE7 is controlled by a registry key. (An addon could probably toggle it. I just don't know of any.)
So, how I handle this is to write a registry script to turn it on or off. Then, I put a link to those scripts on my windows quick-launch bar and change their icons to be more appropriate. Then, I can just click one of the links to turn on or off IE script debugging.
Turn Off:
REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Disable Script Debugger"="yes"
"DisableScriptDebuggerIE"="yes"
Turn ON:
REGEDIT4
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Disable Script Debugger"="no"
"DisableScriptDebuggerIE"="no"
Firefox lets you use different profiles. Each profile can have separate preferences, themes and plugins. Start firefox on Windows this way: firefox.exe -ProfileManager to create or manage profiles.
I use Firefox and Webkit for web debugging and Safari for regular web browsing, however. Firefox is just better for web development, and I prefer Safari overall.
I keep those annoying popups on for Internet Explorer, and you're right. It's amazing how few developers ever bother testing their code in IE. As a web developer, it's sorta your duty, right? Seeing as how it still accounts for like 60% of traffic to most sites.
Anyway, in answer to your question, I simply switched to Chrome for everyday browsing, and only use IE for testing and developing.
You have two options.
Change and use a browser that allows you to have site specific configuration (check out Firefox with Firebug), or
Use different browsers for developing and everyday use.
CompanionJS doesn't let you toggle debugging on a domain basis, but makes the error messages less obtrusive for casual surfing, and makes script debugging in general more user friendly.
Chrome doesnt bug you unless you first open the javascript debugger window
If you want to test and debug JavaScript, Firefox and Firebug are unrivalled in terms of features and ease of use. Chrome is not as powerful as Firebug, no matter what anyone else tells you.