首先,你可以对谷歌大喊大叫来解决他们的问题
gmail-greasemonkey
API——它似乎每天都在崩溃。明确地,
registerViewChangeCallback()
将有助于解决问题,但它似乎已停止正常工作。
似乎
//
// ==UserScript==
// @name Fire on page finished (with AJAX mods)
// @namespace Gmail
// @description This script shows one way to wait for an AJAX-heavy page to load.
// @include http://mail.google.com/*
// @include https://mail.google.com/*
// ==/UserScript==
//
if (window.top != window.self) //don't run on frames or iframes
return;
var zGbl_PageChangedByAJAX_Timer = '';
window.addEventListener ("load", LocalMain, false);
function LocalMain ()
{
if (typeof zGbl_PageChangedByAJAX_Timer == "number")
{
clearTimeout (zGbl_PageChangedByAJAX_Timer);
zGbl_PageChangedByAJAX_Timer = '';
}
document.body.addEventListener ("DOMNodeInserted", PageBitHasLoaded, false);
}
function PageBitHasLoaded (zEvent)
{
if (typeof zGbl_PageChangedByAJAX_Timer == "number")
{
clearTimeout (zGbl_PageChangedByAJAX_Timer);
zGbl_PageChangedByAJAX_Timer = '';
}
zGbl_PageChangedByAJAX_Timer = setTimeout (function() {HandlePageChange (); }, 666);
}
function HandlePageChange ()
{
removeEventListener ("DOMNodeInserted", PageBitHasLoaded, false);
alert ('Page has finished loading.');
}