Chrome app navigate htmls without creating windows

前端 未结 2 1729
臣服心动
臣服心动 2021-01-24 04:51

I\'m creating a chrome packaged app, and I need to navigate my htmls without creating a lot of windows, like, if the user click one button, it opens the html in the same window

相关标签:
2条回答
  • 2021-01-24 05:14

    Packaged apps intentionally do not support navigation. Apps are not in a browser, there is no concept of forward, back, or reload. Applications which do require the concept of navigation, or modal dialogs, should use a user interface framework that supports that functionality. In fundamentals, you can navigate by manipulating the DOM or by using CSS to animate and control visibility of components of your app.

    0 讨论(0)
  • 2021-01-24 05:24

    The page you want to navigate to can be opened in a new window, then the previous page can be closed.

    function navigateToLink (link) {
      var current = chrome.app.window.current();
    
      chrome.app.window.create(link);
    
      current.close();
    }
    
    0 讨论(0)
提交回复
热议问题