Noscript causes duplicate content

Ask for help about NoScript, no registration needed to post
Guest

Noscript causes duplicate content

Post 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.
Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0
User avatar
therube
Ambassador
Posts: 7969
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Noscript causes duplicate content

Post by therube »

(Allow/disallow webege.com to see the difference. I actually like the "wrong" page better. The word scriptless comes to mind.)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20110706 Firefox/5.0 SeaMonkey/2.2
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: Noscript causes duplicate content

Post 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>
Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
Guest

Re: Noscript causes duplicate content

Post by Guest »

@therube
Ah ok, so it's not a bug it's a feature :D
I changed the noscript.jsredirectIgnore about:config preference to 'true' and now the page displays properly. Thanks for the 'scriptless' pointer.
Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: Noscript causes duplicate content

Post 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);
        }
Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
Guest

Re: Noscript causes duplicate content

Post 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.
Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Noscript causes duplicate content

Post by Giorgio Maone »

Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: Noscript causes duplicate content

Post by al_9x »

verified
Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Noscript causes duplicate content

Post 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.
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
Post Reply