Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicate a tab in Chrome without Reloading the Page?

Is there any way to completely duplicate the state of a current tab in Google Chrome? I want an exact copy of the current state of the page without having to reload the page in another tab.

An example use case:

While browsing a "slideshow" on a news website, I want to preserve the current slide that I'm on, but create a duplicate so that I can continue viewing the next slide. If I simply Right-Click and "Duplicate" the tab, the new page will completely Reload, reprocessing all of the Javascript and running the pre-slideshow advertisement again.

like image 388
amitparikh Avatar asked Mar 07 '13 20:03

amitparikh


People also ask

How do I repeat a tab in Chrome?

Press Alt+Shift+D to duplicate the current tab (Option+Shift+D on Mac). Shortcut is configurable.

What happens when you duplicate a tab?

If you wanted to view another product page from the same search results, you can duplicate the browser tab. The first product's page remains open in the duplicated tab, allowing you to go back to the search results in the first tab and view the second product's page.

Why do Chrome tabs reload?

Why are my tabs reloading? Your device is out of memory. Like your Android phone or tablet, Chrome is silently closing background tabs in order to make memory available. When you click on one of those tabs it reloads.


1 Answers

In short "NO" you can't.

I am not expert on this but a similar behavior can be achieved in some ways i know :

Dump the whole DOM

Never tried this though. You can convert the DOM to a string, pass it to the new window and then parse it as a document. This will let you lose your DOM events and State manipulation javascript. (But that's good for your case)

var dtab = window.open('about:blank', 'duplicate_a_tab'); dtab.document.open(); dtab.document.write("... yout html string .."); dtab.document.close(); 

Develop an extension

Let the users continue on the current tab with the current state, your extension should be able to capture the screenshot of that area and open that screenshot in new tab. There are plenty of screenshot taking extensions are available in the market.

If that website is your own

You can develop your services that uses state locally like progressive web apps. Give a link separately to 'duplicate' which will eventually open the same URL in different tab with the same local state and with the flag do-not-sync.

This will not work when the user uses browser inbuilt duplicate feature.

like image 145
Voonic Avatar answered Sep 21 '22 08:09

Voonic