I came up with a solution that is not perfect, but meets the requirements:
Here is the bookmarklet code:
javascript:window.open(window.location);window.location="http://www.google.com/";var%20s=document.createElement('script');s.setAttribute('src','http://my-script.js');document.body.appendChild(s);void(0);
Readable stepwise equivalent:
window.open(window.location); // Clone the current tab window.location = "http://www.google.com/"; // Navigate to the desired page url var s = document.createElement('script'); // Create the script s.setAttribute('src','http://my-script.js'); // document.body.appendChild(s); // Embed it into current document
There is only one problem left: the page you want to show is inactive by default. Cloned.
source share