【发布时间】:2011-06-28 12:00:45
【问题描述】:
我有一个 Firefox 插件,它首先显示一个警告/信息页面,告诉用户他们正在被重定向 (chrome://localfilter/content/wait_page.html),然后将他们重定向到他们的目的地。
一切都很好。
唯一的事情是当/如果他们按下后退按钮他们看到“等待页面”,是否有从历史记录中删除那个等待页面并保留其他所有内容? 或者,如果这不可能,则将等待页面替换为可能只有徽标的另一个页面(因为如果他们阅读,他们将被重定向并且什么都没有发生......)
编辑:
// function to see if the banned URL is on the list, then redirect
...
window.stop(); // Totally stop the page from loading.
window.content.location.href = "chrome://quickfilter/content/wait_page.html";
this.notificationBox();
self.timervar = setTimeout(function ()
{
self.main.redirectToAnotherUrl();
}, 2505);
...
redirectToAnotherUrl: function ()
{
window.content.location.href = self.mafiaafireFilterUrl;
self.timervar = setTimeout(function ()
{
self.main.notificationBox();
}, 2005);
}
用替换改变:
redirectToAnotherUrl: function ()
{
window.content.location.replace(self.mafiaafireFilterUrl);
self.timervar = setTimeout(function ()
{
self.main.notificationBox();
}, 2005);
}
【问题讨论】:
标签: javascript firefox firefox-addon history