Skip to content Skip to sidebar Skip to footer

Change Chrome App Window Location, But Not From Main.js

I have made a window, with a couple of buttons. When I click them, I have a function which fires up. Now my question is how can I change the (same) window to show another html file

Solution 1:

You are not supposed to be able to directly change a window's location in a Chrome App. The only part of the location object you can change is the href to reference a fragment in a document.

This was an explicit design decision of the Chrome Apps team to stop apps from having the flash of white whilst it navigates between pages. If you look at the window api the only method is create and that takes the URL of what that window should display.

That being said, you can load an iframe in the main window and change that. You would just need to set the iframe to be 100% of the width and height of the window.


Post a Comment for "Change Chrome App Window Location, But Not From Main.js"