Page 1 of 1
Noscript causes duplicate content
Posted: Sun Jul 31, 2011 12:38 pm
by Guest
I've just found a weird problem - NoScript causes a simple xhtml page I wrote to display duplicate content in Firefox 5 (Linux), as though all of the divs are present twice in different locations on the page.
There is no javascript in the page, just xhtml and css. When I disabled every extension except NoScript the problem persisted. When I disabled NoScript - but left all other extensions active - the problem disappeared and the page viewed correctly.
When I enabled all extensions, and allowed javascript via NoScript, the problem also disappeared - even though the page contains no javascript. The page works fine in Opera and Chromium, with or without javascript enabled. The page url is '
http://lorem-ipsum.webege.com/index.html'. I'm baffled, any help appreciated.
Re: Noscript causes duplicate content
Posted: Sun Jul 31, 2011 12:51 pm
by therube
(Allow/disallow webege.com to see the difference. I actually like the "wrong" page better. The word
scriptless comes to mind.)
Re: Noscript causes duplicate content
Posted: Sun Jul 31, 2011 5:02 pm
by al_9x
here's a distillation, must be loaded from http: not file:
Code: Select all
<div style="position:absolute;top:100">
<a href=""><span style="position: absolute">dupe</span></a>
</div>
Re: Noscript causes duplicate content
Posted: Sun Jul 31, 2011 10:45 pm
by Guest
@therube
Ah ok, so it's not a bug it's a feature
I changed the noscript.jsredirectIgnore about:config preference to 'true' and now the page displays properly. Thanks for the 'scriptless' pointer.
Re: Noscript causes duplicate content
Posted: Sun Jul 31, 2011 11:33 pm
by al_9x
Guest wrote:I changed the noscript.jsredirectIgnore about:config preference to 'true' and now the page displays properly.
hasVisibleLinks thinks the link is invisible and so detectJSRedirects clones it, to make it visible.
Code: Select all
if (!hasVisibleLinks && (document.links[0] || document.forms[0])) {
let links = document.links;
for (let j = 0, len = links.length; j < len; j++) {
let l = links[j];
if (!(l.href && l.href.indexOf("http") === 0)) continue;
l = body.appendChild(l.cloneNode(true));
l.style.visibility = "visible";
l.style.display = "block";
seen.push(l.href);
}
Re: Noscript causes duplicate content
Posted: Mon Aug 01, 2011 12:48 am
by Guest
@ al_9x
Thanks for the clarification. So maybe it is a bug after all, because the links in my page are not invisible - but they do contain hidden spans that I display on css :hover action as part of the link styling. It's all standards-compliant css behaviour, but it seems NoScript's detection method isn't smart enough to tell the difference.
Re: Noscript causes duplicate content
Posted: Mon Aug 01, 2011 4:43 pm
by Giorgio Maone
Re: Noscript causes duplicate content
Posted: Mon Aug 01, 2011 5:21 pm
by al_9x
verified
Re: Noscript causes duplicate content
Posted: Mon Aug 01, 2011 5:32 pm
by Giorgio Maone
Guest wrote:NoScript's detection method isn't smart enough to tell the difference.
NoScript's method was
too smart, using size rather than CSS computed styles to tell the differences.
Unfortunately, Gecko doesn't report size correctly (or at least all your anchors are reported as collapsed to 0 width and height), so I had to make NoScript dumber and just check for
display and
visibility of the link and its ancestors.