browser-tab

How can I set the browser tab's anchor target name via javascript?

若如初见. 提交于 2021-02-07 08:12:35
问题 When my website is called from an external hyperlink it shall be re-opened within the same browser tab, if it is already open. This can be achieved by specifying an appropriate target attribute within the hyperlink's HTML: <a href='http://my-website.org' target='my_target' /> However, this does not work, if the first tab is opened without a target being specified, e. g. by directly typing in the website's url. After this the hyperlink using my_target will pull up a second browser tab. So, I

javascript. Can't open new tab in safari

我与影子孤独终老i 提交于 2019-12-22 14:04:13
问题 The following javascript opens a new tab fine in Firefox, chrome, and IE. but it opens a new window in safari. javascript:window.open(url,'_blank'); // opens new window in safari. I need to open a new tab NOT a new window in safari. anyone else seeing this behavior? fixes? I can't seem to find any recent posts that address this... maybe it's just me. -Thanks. Using safari 5.1.7 on windows. 回答1: It turns out it's a browser preference, which can be edited under Edit -> Preferences -> Tabs and

Store browser tab specific data

半腔热情 提交于 2019-12-21 03:42:51
问题 I have a web application that store information about recently visited pages, let's call them A. When a user visits another page type, called B, I render a menu at the top with a button to point to the most recently visited A-page. The B-pages are accessible either through an A page or a B page and can by the user be considered a property of A. This works fine but it becomes a problem when someone opens two tabs and when being on a B-page in tab 1 with a link to the A-page A1 they open a new

Get Browser Tab Index/Id

你。 提交于 2019-12-19 16:55:02
问题 So in most current browsers there is the feature of Tabs, is there a way to get the Tab index? so Tab 1 has www.google.com opened in it and Tab 2 has www.google.com opened in it, is there a way to identify what the Tab index is? Pseudo Code: if($tab == 2) { alert "Tab 2 is active\n"; } if($tab == 1) { alert "Please use Tab 2 as this is Tab 1\n"; } Funny as everything I search for about tabs is related to the tab index of the webpage itself, sigh... 回答1: Strictly speaking. TABS are on the end

How can you display a session timeout warning that is smart enough to handle multiple open browsers or tabs

大城市里の小女人 提交于 2019-12-12 08:19:25
问题 I have implemented a session timeout warning using javascript that simply asks the user if they want to extend their session or logout. The problem is that this is for an intranet portal where power users will often have several browser windows or tabs open at the same time to the application. Currently, they will be prompted that they are about to be logged out from every browser window. How can I make the code smarter to detect that they are actively using another browser session? 回答1: You

check if a browser tab is already open so I don't make extra tabs

*爱你&永不变心* 提交于 2019-12-12 07:26:12
问题 When a user adds an item to our shopping cart it opens our store in a new tab. Different websites oddly enough. I would like to check if the tab is already open and then repopulate it it with the second item instead of opening another tab with the updated cart. Is there a way to check this with js? I imagine I can track that we opened the tab but I don't see how I can confirm that it wasn't closed in the time between adding items to the cart without doing some ajax requests pinging both pages

Detect page refresh or new load using PHP or Javascript

你说的曾经没有我的故事 提交于 2019-12-12 03:21:45
问题 How to detect tab close in browsers using PHP or Javascript. In other words, How to find if page is refreshed or opened in new tab. I am concerned about tab, not browser. 回答1: You can have a listener for the window.onbeforeunload event. You won't be able to detect if the tab is closed from JavaScript, though. 回答2: Actually Javascript can tell you if a Tab is going to be closed. Two different methods need to be used (one for IE and one for everyone else). I wrote a Javascript process to do

javascript. Can't open new tab in safari

三世轮回 提交于 2019-12-06 12:38:47
The following javascript opens a new tab fine in Firefox, chrome, and IE. but it opens a new window in safari. javascript:window.open(url,'_blank'); // opens new window in safari. I need to open a new tab NOT a new window in safari. anyone else seeing this behavior? fixes? I can't seem to find any recent posts that address this... maybe it's just me. -Thanks. Using safari 5.1.7 on windows. It turns out it's a browser preference, which can be edited under Edit -> Preferences -> Tabs and select the Automatically option in the drop-down menu Open pages in tabs instead of windows . Modify your

Chrome-Extension: iterate through all tabs?

谁说胖子不能爱 提交于 2019-12-04 08:54:27
问题 How would I iterate through all tabs a user has open and then check if they have a particular HTML item with id = 'item' ? 回答1: You can make it like this : chrome.tabs.getAllInWindow(null, function(tabs){ for (var i = 0; i < tabs.length; i++) { chrome.tabs.sendRequest(tabs[i].id, { action: "xxx" }); } }); After that to look after your item, if you can make it like this : document.getElementById('item') Don't forget that you can't manipulate the HTML by using the "background page" So the first

How can you display a session timeout warning that is smart enough to handle multiple open browsers or tabs

强颜欢笑 提交于 2019-12-03 23:01:37
I have implemented a session timeout warning using javascript that simply asks the user if they want to extend their session or logout. The problem is that this is for an intranet portal where power users will often have several browser windows or tabs open at the same time to the application. Currently, they will be prompted that they are about to be logged out from every browser window. How can I make the code smarter to detect that they are actively using another browser session? You'd have to check the session state on the server using Ajax and keep track of all the open sessions/windows