C|Net and ABE

Discussions about the Application Boundaries Enforcer (ABE) module

C|Net and ABE

Postby wtrhzrd » Thu Jul 21, 2011 10:46 pm

With ABE enabled I can't seem to get the photos of review products to work. It's a mouseover and see the image like you see
here as example: http://reviews.cnet.com/smartphones/t-m ... ag=nl.e723.
If I disable ABE it works fine. I tried playing with adding various rules, but I don't really know what I'm doing other than
toying around with variations of the other rules I see on the FAQ. Is there a way to make those pages work that I'm
missing?
Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0
wtrhzrd
 

Re: C|Net and ABE

Postby al_9x » Fri Jul 22, 2011 12:02 am

You probably have twitter.com inclusions blocked in abe. The cnet page has a bug, their test for the existence of the twttr object (if (twttr)), itself throws an error and breaks the page. Your quickest solution is to allow twitter on cnet.

@Giorgio

If twitter were blocked by the NS script module, the following surrogate would take care of it:

Code: Select all
user_pref("noscript.surrogate.twitter.sources", "platform.twitter.com");
user_pref("noscript.surrogate.twitter.replacement", "twttr=function() { var p = Proxy.createFunction({get: function(proxy, name) { return name in Object.prototype ? Object.prototype[name] : p; }}, function() { return p; }); return p; }();");


but it looks like when a script is blocked by abe, script surrogates don't run. Is that an omission or by design? I think it would make sense if they did.
Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
al_9x
Master Bug Buster
 
Posts: 871
Joined: Thu Mar 19, 2009 4:52 pm

Re: C|Net and ABE

Postby wtrhzrd » Fri Jul 22, 2011 12:13 am

Hmm, actually that was it... it works now with NO rules for cnet at all. I had added:

#Deny INCLUSION(SCRIPT, OBJ, SUBDOC)
Site .twitter.com .twimg.com
Accept from .twitter.com .twimg.com
Deny INCLUSION

at some point in time from somewhere, either the forums here, or the faq page, can't remember now.

If I pull that out, it works perfectly fine with no specific cnet rules at all. That seems strange but oh well,
it worked. Thanks.
Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0
wtrhzrd
 

Re: C|Net and ABE

Postby wtrhzrd » Fri Jul 22, 2011 12:17 am

And like you asked, I wonder also is that by design. If so, no problem but not knowing much about
the advanced "stuff" in noscript it does seem strange that that particular function no a site like
cnet wouldn't work just because of something to do with twitter. Or is it just that somehow the
script on that site for twitter happened first and everything after that in the scripts from the site
didn't run properly?
Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.0
wtrhzrd
 

Re: C|Net and ABE

Postby al_9x » Fri Jul 22, 2011 12:28 am

You're wondering about something different, why cnet breaks without twitter. That has nothing to do with NS, their test for the twitter object is bad, throws an exception.
Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
al_9x
Master Bug Buster
 
Posts: 871
Joined: Thu Mar 19, 2009 4:52 pm

Re: C|Net and ABE

Postby Giorgio Maone » Fri Jul 22, 2011 6:32 am

al_9x wrote:but it looks like when a script is blocked by abe, script surrogates don't run. Is that an omission or by design? I think it would make sense if they did.

It is an omission by design: one of the design criteria was keeping at the bare minimum the intersection between NoScript and ABE, and load type awareness (i.e. "this is a script, that is a frame") was not included in the first specification (before INCLUSION was added).
However at this point relaxing a bit this criterion may make sense, and this use case surely deserves attention.
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
User avatar
Giorgio Maone
Site Admin
 
Posts: 6834
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy

Re: C|Net and ABE

Postby Giorgio Maone » Sat Jul 23, 2011 12:36 pm

Giorgio Maone wrote:However at this point relaxing a bit this criterion may make sense, and this use case surely deserves attention.

Done in latest development build.
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
User avatar
Giorgio Maone
Site Admin
 
Posts: 6834
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy

Re: C|Net and ABE

Postby al_9x » Sat Jul 23, 2011 7:54 pm

verified

About the surrogate, what is this for:

Code: Select all
if(typeof Proxy==='undefined')return arguments.callee


It doesn't seem like it would do anything useful in 3.x, as there's usually a call on a twttr child object.
Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
al_9x
Master Bug Buster
 
Posts: 871
Joined: Thu Mar 19, 2009 4:52 pm

Re: C|Net and ABE

Postby Giorgio Maone » Sat Jul 23, 2011 8:18 pm

al_9x wrote:
Code: Select all
if(typeof Proxy==='undefined')return arguments.callee


It doesn't seem like it would do anything useful in 3.x, as there's usually a call on a twttr child object.

Indeed, in next build it will be changed into
Code: Select all
if(typeof Proxy==='undefined')return{events: {__noSuchMethod__: arguments.callee}}
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
User avatar
Giorgio Maone
Site Admin
 
Posts: 6834
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy

Re: C|Net and ABE

Postby al_9x » Sat Jul 23, 2011 8:41 pm

I've seen another sub-object used ("anywhere"), which required the following surrogate:

Code: Select all
twttr={anywhere:function(){}};twttr.anywhere.__noSuchMethod__=function(){};


anywhere was itself called and also had its methods called.
Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
al_9x
Master Bug Buster
 
Posts: 871
Joined: Thu Mar 19, 2009 4:52 pm

Re: C|Net and ABE

Postby al_9x » Sun Jul 24, 2011 12:20 am

Giorgio Maone wrote:
Code: Select all
if(typeof Proxy==='undefined')return{events: {__noSuchMethod__: arguments.callee}}

Why "arguments.callee" ?
Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
al_9x
Master Bug Buster
 
Posts: 871
Joined: Thu Mar 19, 2009 4:52 pm

Re: C|Net and ABE

Postby Giorgio Maone » Sun Jul 24, 2011 7:18 am

al_9x wrote:
Giorgio Maone wrote:
Code: Select all
if(typeof Proxy==='undefined')return{events: {__noSuchMethod__: arguments.callee}}

Why "arguments.callee" ?

Habit. Since it's not anonymous, using "twttr" is OK too to make the hack recursive.
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
User avatar
Giorgio Maone
Site Admin
 
Posts: 6834
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy

Re: C|Net and ABE

Postby al_9x » Sun Jul 24, 2011 9:27 am

Giorgio Maone wrote:
al_9x wrote:
Giorgio Maone wrote:
Code: Select all
if(typeof Proxy==='undefined')return{events: {__noSuchMethod__: arguments.callee}}

Why "arguments.callee" ?

Habit. Since it's not anonymous, using "twttr" is OK too to make the hack recursive.


Returning twttr is perhaps slightly better than constructing a new object each call, but either way it seems to serve no real purpose. It supports the following chaining:

twttr.events.whatever1()
.events.whatever1()
.events.whatever2()

which I don't think is in use now or ever would be.
Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
al_9x
Master Bug Buster
 
Posts: 871
Joined: Thu Mar 19, 2009 4:52 pm

Re: C|Net and ABE

Postby al_9x » Tue Jul 26, 2011 10:18 pm

the 3.6 fallback is still wrong,

  1. anywhere needs to be a function, not just an object
  2. __noSuchMethod__ needs to be a function, not twttr object
  3. twttr is not defined in the function

let me write it and you can review it.

Code: Select all
twttr = function () {
   var srgt;
   if (typeof Proxy === 'undefined') {
      srgt = { events: { __noSuchMethod__: function() {} },
               anywhere: function() {} };
      srgt.anywhere.__noSuchMethod__ = function() {};
   }
   else
      srgt = Proxy.createFunction({
            get: function (proxy, name) {
            return name in Object.prototype ? Object.prototype[name] : srgt;
         }},
         function() {
            return srgt;
         });
   return srgt;
}();
Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
al_9x
Master Bug Buster
 
Posts: 871
Joined: Thu Mar 19, 2009 4:52 pm

Re: C|Net and ABE

Postby Giorgio Maone » Tue Jul 26, 2011 10:59 pm

Why creating 3 empty anonymous functions (each one is a different object)?
Code: Select all
if (typeof Proxy === 'undefined') {
  var f=arguments.callee;
  return f.__noSuchMethod__=f.events=f.anywhere=f;
}
Mozilla/5.0 (Windows NT 5.2; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
User avatar
Giorgio Maone
Site Admin
 
Posts: 6834
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy

Next

Return to ABE

Who is online

Users browsing this forum: No registered users and 1 guest

cron