Can we register global hotkeys for a browser - windows

We want to register browser events even when the browser is minimized or not in focus. For example, suppose we are doing something in Microsoft Word and if we press a key on the keyboard (which is not associated with any shortcut of Word or the Windows OS), it should open a new tab in Google Chrome.

The solution will be browser specific. You'll need to create an XPCOM plug-in for Firefox, native app for Chrome, extension for IE, etc. This browser specific add-on will have to register each hotkey with the Windows API and then handle hotkey events as you desire; this of course means you will need to use a language that can access the Windows API. Depending on what you want to automate in the browser you might need to create an additional plugin in pure javascript to gain full access to the browser API.

Related

Use Browser is missing settings like "Private" & "NewSession" in the Modern Design

For me that's a huge step back. The new Use Browser is missing settings like Private & NewSession in the Modern Design. So it's not possible to open Chrome in private mode anymore. So currently the only workaround is to hit CTRL+SHIFT+N as Chrome shortcut:
But for me that does not sound like a good solution as browsers can swap that hotkey or having different.
So before without the Modern Design is was possible to set incognito mode in Open Browser:
So why is that feature gone in the Modern Design rework? How to get it back without the workaround and still using the Modern Design?
Private coming 21.4
New session is gone forever because it was targeting IE only, which is out of support
There is a workaround that already allows the incognito mode now in Chrome:
Add Application/Browser
Add new Chrome Application to the Object Repository (or click Indicate application ...)
Now do NOT create a screen (if the Create screen window is now opened close it)
Select the Use Browser Chrome and go to property Unified Application Target > Arguments
Type in --incognito
Click on the Burger menu of Use Browser Chrome
In the dropdown select Add Screen to Object Repository
Create the Screen now
All done. When you now check Use Browser Chrome for the Unified Application Target > Arguments it should still say --incognito.

Open a popup (e.g. native browser) from a Teams desktop client app tab

Is there any way to pop open a browser window from a Teams app tab (desktop client)?
I came across the following link and from my interpretation of the reply it seems it's not possible.
Quoted from link for reference:
Unfortunately it’s not possible to use window.open in Teams tabs. Because we block opening of new windows to arbitrary sites within our Teams Desktop Client (for security reasons) you need to always use microsoftTeams.authentication.authenticate (if you want a popup window) or microsoftTeams.tasks.startTask (if you want an iframe-based dialog) to open a secondary app view.
It's not very clear to me what the microsoftTeams.authentication.authenticate reference above is suggesting.
Alternatively, if not a browser window, can we attempt to open another app installed on the device (e.g. Excel)?
Thanks in advance!
Are you just wanting to launch a new browser entirely? If so, a regular anchor tag, with a target attribute (e.g. ...), will work fine (I'm doing this in a tab myself, and it's working without problem).
You could try using a TaskModule to open a custom HTML/ Javascript or an iframe based widget inside a popup from within your Teams tab.
microsoftTeams.authentication.authenticate() will let you Authenticate the user against you tab. You can find the docs for this here.

Get Window Handle (HWND) in chrome extension

I am developing a chrome extension which uses chrome's native messaging api to communicate to a host application. The host application is written in C++. Now my host application requires the Window Handle HWND of the chrome tab in which my extension is currently active.
Is there a way to do this? I can't use any of the NPAPI solutions.
I have gone through the documentation of the chrome extensions there doesn't seem to be a way to do this.
I have seen this answer: Get Window Handle of Chrome Tab from Within Extension?
But the above answer doesn't explain things clearly. Is it asking for matching the title of windows by iterating through all the windows? How do I do this? What if multiple tabs have the same title? Can Tab Id or window Id be used in some way?

Windows 7 taskbar thumbnails for one app (such as in IE8)

Under Windows 7, IE 8 shows every open tab as a taskbar thumbnail. How can I achieve this in my own app?
MSN Messenger exhibits the same behavior.
I believe that this is done with the Windows API Code Pack: http://code.msdn.microsoft.com/WindowsAPICodePack
And here's a blog post explaining how "custom window previews can be used to expose a list of child windows (browser tabs) as thumbnail- and peek-enabled windows in the taskbar." Sounds like what you need: http://blogs.microsoft.co.il/blogs/sasha/archive/2009/02/12/windows-7-taskbar-apis.aspx
The following article should help. There are several new taskbar features in Windows 7, all of them are discussed at the link below.
http://msdn.microsoft.com/en-us/magazine/dd942846.aspx
Note that the Aero Peek feature has nothing to do with task bar buttons, it just lets you make all windows fully transparent to preview your desktop and gadgets. What you were actually looking for is "Windows 7 Grouped Taskbar Thumbnails", in case you need to do additional searches.
This is the best reference I've got. Note that I'm assuming native code here, a .NET equivalent could be p/invoke'd up in a fairly straight forward manner.
It boils down to the following:
For each tab, create a proxy window
For these windows call DwmSetWindowAttribute to set DWMWA_FORCE_ICONIC_REPRESENTATION & DWMWA_HAS_ICONIC_THUMBNAIL
Whenever these proxy windows receives a WM_DWMSENDICONICLIVEPREVIEWBITMAP message, render the corresponding thumbnail into the proxy window
Whenever a proxy window receives a WM_ACTIVATE, switch to the correct tab
You also need to handle WM_SYSCOMMAND
Grab your ITaskbarList4
Use it to register each of your proxy windows as a tab
Manage tab order and what not via the ITaskbarList4 interface (this includes activating tabs)
It seems like there should be a better way to do this, but its all I'm aware of at the moment.

Open a URL in Firefox in current tab/window from a Windows application?

I have a Windows application that works with Firefox. If Firefox is already open, I'd like to have it open a given URL in the current tab+window as is currently showing. Our application tends to open a lot of URLs and reusing the same browser window makes the most sense. I already have a COM application that works with Internet Explorer, but haven't been able to find something similar for an external application to work with Firefox.
The only way I know of to do this in Firefox is to set the browser.link.open_newwindow preference to 1. Unfortunately this also stops all in-page links from opening a new tab or window.
If you use SeaMonkey as your default browser then you can use the Preferences window under Tabbed Browsing or Link Behaviour to make links from external applications open in the current tab.

Resources