Can I programatically make my website go to full screen via F11? - javascript

I want to make my page viewed at full screen.
How can I programatically press F11 on page load. Is it possible?
Thank you

No - not possible without JavaScript. And only then, you can open a large new window, but not emulate pressing F11.
Also, changing browser window sizes without the user's consent is very frustrating for them.

It is not possible to open a window full screen on load. It is not possible to resize the page you are loading.
What you can do is to open a max size child window, say on click of a button etc (if you do it onload, popup blockers would block it).
If it is a corporate intranet then perhaps you can add a rule to all your browsers to add your site to the popup blicker whitelist.
You can also use flash (etc) to open a document full screen, but this is not probably what you are looking at.

Related

fullscreen popup in new window

I'm trying to make a popup window fullscreen, completely fullscreen, no borders.
I've found scripts (a great one by David Walsh) that set the current page or any element on the page to fullscreen, but I can't get them to work on a popup window.
The limitation is that you can't go fullscreen without the users approval, so he or she must click, but it seems that that "approval" does not carry over to a new window.
Is there a way to carry over this approval or get the new window fullscreen?
I'm leaning towards no and I'm thinking of implementing a way with a hidden div on the page that loads content on focus via ajax or iframe (just brainstorming not tested yet).

Browser Back Button in Modal Window (Lightbox)

I am loading content from WebsiteA.com into a Modual Window (LightBox). The Modal Window is embedded on WebsiteB.com (and not WebsiteA.com).
The user is able to navigate within the Modual Window but if he/she clicks on the Browser Back button the Modual Window closes.
Is there a way to use the Browser Back button to navigate within the Modal Window?
Regardless of being on one website or two, it's not possible to override your browser's back button, due to security reasons (e.g. "fake" browser navigation", countless phishing opportunities, etc).
If they were on the same website domain, you could get around this using various methods, such as redirecting to the same URL, but with a different hash fragment.

Can I remove parent window when opening a new window?

I'm having an issue with a our main application's window activating itself when the mouse is hovered over it.
I'm opening the new window in a javascript function using the line below:
window.open(URL, 'Requests', 'location=no,toolbar=no,status=yes,scrollbars=yes,resizable=yes');
I have noticed that if I open a new IE window through Explorer, hovering over our main application's window does not reactivate itself. Even in this case though, the main window does make itself be "on top" of the pop-up window created by the window.open command above.
The question is this: Is there any way, when opening a "child" window in javascript, to detach the child window from the parent?
Further info: I am using an Infragistics WebDataMenu with ActivateOnHover set to true so users don't need to click on main menu items to see sub-menu choices. Unfortunately, that setting sensitizes the whole menu bar so that sliding the mouse through it activates the menu (and sadly the window when a popup is active). This is the root behavior I'm trying to fix.
The window.open(); method will create a popup window that really only shares a relationship through JavaScript via the return value of the call, and the window.opener property on the popup window.
What you want is the behavior of a modal window that locks out interaction from the 'parent' page while you work on the 'child' popup.
You can try to fight with JavaScript (and your users) by forcing a focus on the popup and blocking any blurring but this will drive users nuts when they want to go read their email etc. (eg not recommended)
You can also use the not so standard showModalDialog(); method but support is far from fully cross browser and there are a whole bunch of new problems if you try to use this (no right click in IE, zoom issues in IE, and no grandchildren popups to name a few) (again not recommended)
What you can do is make an "overlay" popup similar to many online photo viewers where you first overlay a mask (typically semi transparent) that blocks mouse/focus on the entire page content below and then overlay that with your "popup content". Just be sure that you provide a close option that removes the mask when the overlay is closed/done.
Note if you need to support IE6 you'll also need an iframe shim (Google if needed)
Many UI frameworks will provide a "dialog" just like this for you. (Eg jQueryUI)
Ultimately, I gave up on making this work. I found that what I had to do was turn off ActivateOnHover from the WebDataMenu, which didn't answer this question and requires users to click on the menu to make it drop down, but it became a work-around.

How can I create a full screen, borderless browser/ temporarily hide the browser window?

Is there be a way for me to view a web page in a borderless window, perhaps by manipulating the DOM? Even if it were to only work in a specific browser, this would be fine. Ideally, the window would be able to be closed, perhaps by mousing to the top of the screen?
In most browsers, you can press F11 for full screen mode.
You can do this with the Pennywise Browser. There's a few options to select like View > Frameless Window and View > Toggle Navbar but it does what you're requesting.

How to keep video playing when going back to previous page in JS

I have a page that has a table whose rows are links to other pages.
When there is a click on a row (link), I set location to that URL like this:
window.location=mytable.rows[temp_no].getElementsByTagName("a")[0];
And in one of those link, a video player starts to play a file in the link and I want it to keep playing when I go back to the previous page so that I can listen to the music when browsing other links.
I go to the previous page with:
window.location.href="..";
This destroys everything i.e. video player naturally. I can't popup a new window or open video player in a new window since this application works on devices which have single browser window.
Any solutions ?
Of course it does. Changing the location causes the full page to be unloaded and the new one to be loaded.
If you do not want this behaviour you'll have to use AJAX to reload only parts of your site.
Opening the video in a popup window would be another solutionbut new windows are usually annoying, so provide the user e.g. with a "open video in new window" link.
Edit: In this case - assuming the TV browsers have sane JavaScript engines - use AJAX.
Another "solution" would be adding an onbeforeunload event to request confirmation from the user before he navigates away from the page.
Without being able to use a new window or AJAX it is impossible unless you use frames and just load another page in a different frame.
Use window.open on your videos in a different window so the parent window can navigate wherever.
Keep in mind that you'll have to disable any pop-up blocker.
** UPDATE **
If you need everything in the same window, consider using some iframe to view other pages. The advantage of iframes is that they have their own CSS styles, Javascript sandbox so any page viewed within an iframe does not (generally) affect it's parent container. Of course, there are ways to communicate between an iframe and it's parent and vice versa. But this is out of the question scope.

Categories

Resources