我想出了一个不完美但符合要求的解决方案:
这是书签代码:
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);
可读的逐步等效为:
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
只剩下一个问题:您要显示的页面默认情况下是不活动的。克隆的是。