src != location.href for frames

Bug reports and enhancement requests
Post Reply
dhouwn
Bug Buster
Posts: 968
Joined: Thu Mar 19, 2009 12:51 pm

src != location.href for frames

Post by dhouwn »

A weird script using old-school DOM access to check for "frame manipulations" does not let me log-in when I have frame blocking on all sites activated.

BTW: Frame placeholders do not resize.
Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64; en-US; rv:1.9.3a5pre) Gecko/20100601 Firefox/3.7
dhouwn
Bug Buster
Posts: 968
Joined: Thu Mar 19, 2009 12:51 pm

Re: src != location.href for frames

Post by dhouwn »

To illustrate the problem:

Code: Select all

<!DOCTYPE html>
<html>
  <head>
    <script>
      window.setTimeout(function() {
        alert(document.getElementById('frame').src);
        alert(frame.location.href);
      }, 2000);
    </script>
  </head>
  <frameset>
    <frame src="http://www.example.org/" name="frame" id="frame">
  </frameset>
</html>
Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64; en-US; rv:1.9.3a5pre) Gecko/20100601 Firefox/3.7
User avatar
Giorgio Maone
Site Admin
Posts: 9527
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: src != location.href for frames

Post by Giorgio Maone »

Are you actually outlining a NoScript bug and/or proposing a solution/work-around other than enabling frames for that site (or using a script surrogate to neutralize the script)?
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
dhouwn
Bug Buster
Posts: 968
Joined: Thu Mar 19, 2009 12:51 pm

Re: src != location.href for frames

Post by dhouwn »

I am proposing that NoScript should spoof "location.href" just like it apprently spoofs the "src" property for frame element placeholders.
Mozilla/5.0 (Windows; U; Windows NT 6.1; Win64; x64; en-US; rv:1.9.3a5pre) Gecko/20100602 Minefield/3.7a5pre
User avatar
Giorgio Maone
Site Admin
Posts: 9527
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: src != location.href for frames

Post by Giorgio Maone »

Unfortunately this is far from trivial, because it would require attaching expando properties to each placeholder, and therefore should be done injecting a content-level script which "knows" about placeholders (i.e. performance hit and added complexity).
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
dhouwn
Bug Buster
Posts: 968
Joined: Thu Mar 19, 2009 12:51 pm

Re: src != location.href for frames

Post by dhouwn »

I can simply override those properties which only become visible when you use DOM Access 0?
Well, I guess it would be simpler for me to simply override the checking function (all inline scripts BTW) on DOMContentLoaded…
Mozilla/5.0 (Windows; U; Windows NT 6.1; Win64; x64; en-US; rv:1.9.3a5pre) Gecko/20100602 Firefox/3.7
Post Reply