-1

I am coding a page (for internal use at my company) to try and trigger "one click" browser based video conferencing. We use a web based video conferencing solution (www.bluejeans.com). Currently to start a video session, the user navigates to a url (www.bluejeans.com/, and logs in. We use this with a camera and projector, so the user then needs to drag the browser window onto the projector screen, maximise the window, and hit F11 to remove the browser gubbins.

I want to streamline the process to the user clicks a link, and the new browser window is opened at the correct link, maximised, moved to the correct screen and "F11'd" (browser bars etc removed).

The application is a c# web application, but I assume I'll need to use javascript for this client side window manipulation. I can get a window to open maximised, but can not make it remove the border / address bar.

Having read round it looks like it's for security reasons, which makes sense. However, given that I'm in a "closed" environment, I wonder if there's any other approach I could use? For example a Windows Forms app to trigger a new window?

Edit:

This is different to other questions I have seen that resize the content within the browser to make specific elements full screen. In this case I want to interact with the browser itself, hiding the toolbars and simulating an F11 keypress.

Ben
  • 4,281
  • 8
  • 62
  • 103
  • @Frederic Hamidi - if I am reading the "duplicate answer" correctly, this is different behaviour in that it is resizing elements within the browser window. I wish to resize the browser window itself. Can you correct me if I am wrong, or remove the duplicate mark from this question, please? – Ben Oct 09 '14 at 09:11
  • Don't read only the accepted answer. The other answers all deal with resizing the browser window (and pretty much all say this is not possible). – Frédéric Hamidi Oct 09 '14 at 09:17
  • http://www.w3schools.com/jsref/met_win_open.asp – acid_srvnn Oct 09 '14 at 09:25
  • @Frederic Hamidi - I think you maybe misread / misunderstood my question. "I wonder if there's any other approach I could use? For example a Windows Forms app to trigger a new window?" I am looking for a) confirmation that it is impossible from a web app (which it appears to be) and b) suggestions for an alternative approach. So far it seems the approach I need to take is to use a Windows Forms app - and I want to know if this is my only/best option. – Ben Oct 09 '14 at 09:30
  • Fair enough, I'll reopen this. You may want to change your title to reflect the points you make in your last comment, though. – Frédéric Hamidi Oct 09 '14 at 09:37

1 Answers1

0

It seems that it is not possible to do from the browser for security reasons. However as per the question I was looking for an alternative for internal client machines on my network. This was achieved with a winforms app:

Process.Start("http://www.google.com");
IntPtr handle = new IntPtr();
bool found = false;
// Get handle of browser window ready to move / bring to front
// Wait for browser process to start before moving on
while (!found)
{
  foreach (Process clsProcess in Process.GetProcesses())
  {
    Console.WriteLine(clsProcess.MainWindowTitle);
    if (clsProcess.MainWindowTitle.Contains("Google"))
    {
      found = true;
      handle = clsProcess.MainWindowHandle;
     }
    }        
     Thread.Sleep(500);
   }
Console.WriteLine("Window Found");
// This method gets the users preferred screen (not included in this code snippet)
ConnectedScreen PreferredScreen = GetPreferredScreen(GetScreens());
if (handle != null) { 
  MoveWindow(handle, PreferredScreen.workingArea.X, PreferredScreen.workingArea.Y,PreferredScreen.workingArea.Width,PreferredScreen.workingArea.Height, true);
  SetForegroundWindow(handle);
}
Thread.Sleep(500);
// Need to send space first if on chrome, or it maximises to last known screen
SendKeys.Send(" ");
SendKeys.Send("{F11}"); 
Ben
  • 4,281
  • 8
  • 62
  • 103