简体   繁体   English

Chrome扩展程序:将popup.html刷新到新的html页面

[英]Chrome-extension: Refresh popup.html to a new html page

I'm developing a chrome extension and I've got my popup.html which is a login page. 我正在开发一个chrome扩展,我的popup.html是一个登录页面。 I'm wondering.. how would I (on successful login) redirect to a new html page (which is loaded in the area where popup.html was?) eg When the user clicks the extension icon, popup.html comes up in the box, on successful login that box changes to a new html page other than popup.html . 我想知道..我(成功登录时)如何重定向到新的html页面(在popup.html所在的区域中popup.html ?)例如当用户点击扩展图标时, popup.html出现在框,成功登录后该框更改为popup.html以外的新html页面。

How would I do this? 我该怎么做?

To permanently change a popup while it is closed: 要在弹出窗口关闭时永久更改它:

chrome.browserAction.setPopup({popup: "new.html"});

If you want to temporary change a popup while it is still open: 如果要在弹出窗口仍处于打开状态时临时更改它:

window.location.href="new.html";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM