我试图在已经全屏模式下使用 javascript 重定向到新的 url,但重定向 currentlt 退出全屏模式,这是我不想要的。我使用了错误的 JS 代码吗?
window.location.href = demo_url;
Run Code Online (Sandbox Code Playgroud)
或者
window.location = demo_url;
Run Code Online (Sandbox Code Playgroud)
事实上,我的做法是错误的 - 如果你使用 Chrome 扩展程序并且想要像我一样的全屏模式,那么你可以使用以下命令:
chrome.windows.getCurrent(null, function(window) {
chrome.windows.update(window.id, {state: "fullscreen"});
})
Run Code Online (Sandbox Code Playgroud)