Page 1 of 1
page never finishes loading
Posted: Tue Mar 09, 2010 10:07 am
by al_9x
Fx 3.6.0, NS 1.9.9.53, new profile, defaults
1) go to
http://www.kinopoisk.ru/
2) temp allow kinopoisk.ru
3) page reloads and stays in the loading state
Re: page never finishes loading
Posted: Tue Mar 09, 2010 4:08 pm
by Alan Baxter
It finishes loading for me if I also TA:
217.16.18.163
217.16.18.207
94.103.92.145
adriver.ru
Re: page never finishes loading
Posted: Tue Mar 09, 2010 10:02 pm
by al_9x
If blocking a particular resource prevents a page from reaching loaded state, that's probably a bug, Giorgio?
Re: page never finishes loading
Posted: Tue Mar 09, 2010 10:08 pm
by Giorgio Maone
al_9x wrote:If blocking a particular resource prevents a page from reaching loaded state, that's probably bug, Giorgio?
I'm investigating, but it's not necessarily a NoScript bug: the page may be checking whether a resource loads successfully in a certain timeframe and attempt a new load if it doesn't.
Re: page never finishes loading
Posted: Tue Mar 09, 2010 10:33 pm
by Giorgio Maone
Giorgio Maone wrote:it's not necessarily a NoScript bug: the page may be checking whether a resource loads successfully in a certain timeframe and attempt a new load if it doesn't.
In fact, the same problem happen if you disable/uninstall NoScript and install ABP with Easylist.
Re: page never finishes loading
Posted: Wed Oct 06, 2010 6:30 pm
by al_9x
Ran into another
site with this problem and decided to get to the bottom of this.
Here's a distillation:
Code: Select all
<script>
var iframe_id = 'iframe1';
document.write('<iframe id="' + iframe_id + '"></iframe>');
(function()
{
var iframe, iframe_doc;
if ((iframe = document.getElementById(iframe_id)) && (iframe_doc = iframe.contentDocument))
iframe_doc.write('<script src="http://untrusted.invalid/"><\/script>');
else
setTimeout(arguments.callee, 100);
})();
</script>
Loading the above with NS results in perpetual loading state. This technique is utilized by
http://www.adriver.ru/ and is in both sites.
Re: page never finishes loading
Posted: Wed Oct 06, 2010 7:12 pm
by Giorgio Maone
al_9x wrote:
Loading the above with NS results in perpetual loading state. This technique is utilized by
http://www.adriver.ru/ and is in both sites.
There's not much I can do about it, aside surrogating a "contentDocument"property on NoScript's placeholder (and contentWindow? and contentWindow.document? and what about contentDocument.write()?) .
I'm not sure whether an iframe blocked by content policies has an accessible contentDocument either: does it work if you block the frame with ABP?
Re: page never finishes loading
Posted: Wed Oct 06, 2010 8:03 pm
by al_9x
Giorgio Maone wrote:al_9x wrote:
Loading the above with NS results in perpetual loading state. This technique is utilized by
http://www.adriver.ru/ and is in both sites.
There's not much I can do about it, aside surrogating a "contentDocument"property on NoScript's placeholder (and contentWindow? and contentWindow.document? and what about contentDocument.write()?) .
I'm not sure whether an iframe blocked by content policies has an accessible contentDocument either: does it work if you block the frame with ABP?
It's not clear from your response, can you repro this with the small test page from my previous post?
If so, do you understand what specifically is causing the perpetual loading state? Please explain. The iframe is not being blocked AFAICT, there are no placeholders. The script is successfully written to the iframe (confirmed by venkman and dom inspector) and blocked by NS.
Re: page never finishes loading
Posted: Thu Oct 07, 2010 3:49 pm
by al_9x
Giorgio Maone wrote:There's not much I can do about it, aside surrogating a "contentDocument"property on NoScript's placeholder (and contentWindow? and contentWindow.document? and what about contentDocument.write()?) .
I really don't understand what you're saying here. What placeholder? Anyway, I did identify the precise cause. In order for the the loading state to go to completion the document has to be closed. One of the doc.written external ad scripts does just that, but since it's blocked, the doc remains open.
It should be possible to fix this with a surrogate for the blocked script. It should probably test that it's in a doc.written frame before calling document.close() Is this the best approach?
Re: page never finishes loading
Posted: Thu Oct 07, 2010 5:47 pm
by Giorgio Maone
al_9x wrote:I really don't understand what you're saying here.
Sorry, I was assuming you were blocking the frame and the perpetual loading was due to a setTimeout() loop.
In your case, even though this is clearly a site bug and wouldn't deserve "fixing", a surrogate against the imported script will probably work.
You can try this:
noscript.surrogate.autoClose.sources
noscript.surrogate.autoClose.replacement
Code: Select all
if (top != self && top.location.href == location.href) setTimeout("try{document.close()}catch(e){}", 100)
Re: page never finishes loading
Posted: Thu Oct 07, 2010 6:32 pm
by al_9x
Giorgio Maone wrote:al_9x wrote:I really don't understand what you're saying here.
Sorry, I was assuming you were blocking the frame and the perpetual loading was due to a setTimeout() loop.
Even if setTimeout were looping it would not keep the doc in the loading state.
Giorgio Maone wrote:In your case, even though this is clearly a site bug and wouldn't deserve "fixing"
How is it a site bug? It only manifests when NS blocks the ad script that closes the document.
I'll make sure the surrogate is working for adriver.ru and post it, in case you decide to include it.
Re: page never finishes loading
Posted: Thu Oct 07, 2010 8:17 pm
by al_9x
Code: Select all
user_pref("noscript.surrogate.adriver.sources", "ad.adriver.ru/cgi-bin/erle.cgi");
user_pref("noscript.surrogate.adriver.replacement", "if (top !== self && top.location.href === location.href) setTimeout('try{document.close();}catch(e){}', 100);");