Chrome app navigate htmls without creating windows

前端 未结 2 1819
臣服心动
臣服心动 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: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();
    }
    

提交回复
热议问题