Translation through Standalone should wait for page to finish loading
When a translator is incompatible with Chrome (or Safari), the page is sent to Standalone for translation (this is probably also broken on zotero.org server). Standalone loads the page and appears to immediately start translation. However, as we've seen previously with automatic translation testing, some pages load a precursor page with little to no content. Standalone translation should wait a bit before translating the page.
E.g.
https://github.com/zotero/translators/pull/545
Currently breaks in Chrome on http://ntrs.nasa.gov/search.jsp?R=19910053222&hterms=jegley&qs=Ntx=mode%20matchallpartial%20&Ntk=All&N=4294937145&Ntt=jegley
(there's no reason for the translator to be incompatible with Chrome, but it illustrates the problem)
Adding some debug code, I see that the following page is being translated by Standalone
addthis.com looks like it might be a pretty popular service, so we are likely to run into this issue in the future. Even with compatible translators, this is probably an issue with the bookmarklet.
Introducing a general delay might be unnecessary (and depending on the delay would probably be quite annoying), so maybe we can add a translator property similar to "delay: true" for automatic testing. Or perhaps there is a way to detect when, say, no HTTP requests have been made (and none are active) from the page for a set amount of time before we begin translation.
E.g.
https://github.com/zotero/translators/pull/545
Currently breaks in Chrome on http://ntrs.nasa.gov/search.jsp?R=19910053222&hterms=jegley&qs=Ntx=mode%20matchallpartial%20&Ntk=All&N=4294937145&Ntt=jegley
(there's no reason for the translator to be incompatible with Chrome, but it illustrates the problem)
Adding some debug code, I see that the following page is being translated by Standalone
<head>[...omitted...]</head><body><div style="visibility: hidden; height: 1px; width: 1px; position: absolute; z-index: 100000;" id="_atssh"><iframe id="_atssh227" title="AddThis utility frame" style="height: 1px; width: 1px; position: absolute; z-index: 100000; border: 0px; left: 0px; top: 0px;" src="//ct1.addthis.com/static/r07/sh114.html#iit=1361949378153&tmr=load%3D1361949377996%26core%3D1361949378072%26main%3D1361949378149%26ifr%3D1361949378154&cb=0&cdn=0&chr=UTF-8&kw=&ab=-&dh=ntrs.nasa.gov&dr=http%3A%2F%2Fntrs.nasa.gov%2Fsearch.jsp%3FNtx%3Dmode%2520matchallpartial%2520%26Ntk%3DAll%26N%3D4294937145%26Ntt%3Djegley&du=http%3A%2F%2Fntrs.nasa.gov%2Fsearch.jsp%3FR%3D19910053222%26hterms%3Djegley%26qs%3DNtx%253Dmode%252520matchallpartial%252520%2526Ntk%253DAll%2526N%253D4294937145%2526Ntt%253Djegley&dt=NASA%20Technical%20Reports%20Server%20-%20Study%20of%20thermal-expansion-molded%2C%20graphite-epoxy%20hat-stiffened%20sandwich%20panels&dbg=0&md=0&cap=tc%3D0%26ab%3D0&inst=1&irt=0&jsl=6&prod=undefined&lng=en-US&ogt=&pc=men&pub=nasacasi&ssl=0&sid=512db2c25b1d842f&srpl=0.00001&srd=0&srf=0.02&srp=0.2&srl=1&srx=1&ver=250&xck=1&xtr=0&og=&rev=119513&ct=1&xld=1&xd=1"></iframe></div><script type="text/javascript" src="http://ct1.addthis.com/static/r07/core065.js"></script></body>
addthis.com looks like it might be a pretty popular service, so we are likely to run into this issue in the future. Even with compatible translators, this is probably an issue with the bookmarklet.
Introducing a general delay might be unnecessary (and depending on the delay would probably be quite annoying), so maybe we can add a translator property similar to "delay: true" for automatic testing. Or perhaps there is a way to detect when, say, no HTTP requests have been made (and none are active) from the page for a set amount of time before we begin translation.