简体   繁体   English

其他选项卡关闭时刷新浏览器选项卡

[英]Refresh browser tab when other tab closes

Is there a way to refresh a webpage in one browser tab when another tab is closed? 关闭另一个标签页后,是否可以在一个浏览器标签页中刷新网页?

I have a website which provides the status of a number crafts available for use (let's call it my 'status' tab). 我有一个网站,提供一些可供使用的工艺品的状态(我们称其为“状态”标签)。 Next, I have a vb application which reads a member's HID card and launches a website where they proceed to signout a craft (let's call this my 'signout' tab). 接下来,我有一个vb应用程序,该应用程序读取会员的HID卡并启动一个网站,让他们继续注销工艺品(我们称其为“退出”标签)。 When they are done, I want to close the 'signup' tab and refresh the 'status' tab. 完成后,我要关闭“注册”标签并刷新“状态”标签。

Ideally, I would like to have something like - on the last page of the signout process, determine the tab id of the 'status' tab, refresh it, and auto-close the 'signout' tab 理想情况下,我想使用类似的方法-在退出过程的最后一页上,确定“状态”标签的标签ID,刷新它,然后自动关闭“退出”标签

You can detect tabs, opened by your tab (popup) 您可以检测由标签页打开的标签页(弹出窗口)

function closeCallback() {
    //your code here
}

var openTab = function(uri, name, options, closeCallback) {
    var win = window.open(uri, name, options);
    var interval = window.setInterval(function() {
        try {
            if (win == null || win.closed) {
                window.clearInterval(interval);
                closeCallback(win);
            }
        }
        catch (e) {
        }
    }, 1000);
    return win;
};

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

相关问题 标签页(或浏览器)关闭时的Chrome onbeforeunload事件 - Chrome onbeforeunload event when tab (or browser) closes 当浏览器或浏览器选项卡关闭时从 jQuery 调用 PHP - Call PHP from jQuery when browser, or browser tab closes 浏览器选项卡在 ReactJS 中关闭时如何触发弹出窗口? - How to trigger popup when browser tab closes in ReactJS? 当用户在 Angular 9 中关闭浏览器/选项卡时如何执行功能? - How to execute functions when user closes browser/tab in Angular 9? 关于用户何时关闭浏览器选项卡或窗口的问题 - Question about when user closes browser tab or window 如何在用户关闭浏览器选项卡时显示弹出窗口? - How to show popup when user closes the browser tab? 当用户关闭浏览器或选项卡时如何注销用户 - How to logout the user when user closes the browser or tab 浏览器选项卡或 window 关闭时是否会触发通用事件? - Is there a generic event that is fired when a browser tab or window closes? 检测特定选项卡何时关闭 - Detect When Specific Tab Closes IE 11 - 带有事件侦听器的 Loacalstorage 在从一个选项卡注销时刷新其他浏览器选项卡中的页面,在 IE 中不起作用 - IE 11 - Loacalstorage with an event listener to refresh the pages in other Browser tabs when logged out from one tab, does not work in IE
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM