__noSuchMethod__ for blocked dummy nodes and placeholders

Bug reports and enhancement requests
Post Reply
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

__noSuchMethod__ for blocked dummy nodes and placeholders

Post by al_9x »

When flash is blocked, youtube channel pages can't be switched to grid view mode because the view selection code tries to call pauseVideo on the blocked player.

I made a surrogate for this, Girogio, can you vet it and possibly include it (or the suggestion below)?

Code: Select all

noscript.surrogate.youtube_channel.sources=@.youtube.com/user/*
noscript.surrogate.youtube_channel.replacement=addEventListener('load',function(){playnav.getPlayer().__noSuchMethod__=function(){};},true);
It occurred to me that perhaps all dummies should get the __noSuchMethod__ by default, making such surrogates unnecessary, what do you think?

if I understand correctly, the dummy is eventually replaced by the placeholder with the same id, but can be kept alive by references to it. So I guess both the dummy and the placeholder would need __noSuchMethod__ , in case some code calls getElementById?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Post by Giorgio Maone »

Sounds like a neat idea. I'm gonna try including it in the Flash patch and placeholder building code, rather than as a surrogate.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Post by al_9x »

Giorgio Maone wrote:I'm gonna try including it in the Flash patch
what about non flash objects, don't they also end up as disconnected dummy nodes, shouldn't they also get it since they can also be scripted?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Post by Giorgio Maone »

al_9x wrote:
Giorgio Maone wrote:I'm gonna try including it in the Flash patch
what about non flash objects, don't they also end up as disconnected dummy nodes, shouldn't they also get it since they can also be scripted?
Maybe in theory, but in practice only Silverlight and Flash are used so tightly integrated in the hosting page via scripting to require such a trick.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Post by al_9x »

Giorgio Maone wrote:
al_9x wrote:
Giorgio Maone wrote:I'm gonna try including it in the Flash patch
what about non flash objects, don't they also end up as disconnected dummy nodes, shouldn't they also get it since they can also be scripted?
Maybe in theory, but in practice only Silverlight and Flash are used so tightly integrated in the hosting page via scripting to require such a trick.
I think scripting of various players, like quicktime is also common. Is there a downside to giving every dummy plugin node nosuchmethod? Any scripting of these plugins will result in uncaught exceptions that will disable lot's of code on the page, I can only see an upside in limiting such errors.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Post by Giorgio Maone »

al_9x wrote: Any scripting of these plugins will result in uncaught exceptions that will disable lot's of code on the page, I can only see an upside in limiting such errors.
Giving it only to blocked objects only and their placeholders is a good idea, albeit not so easy to be reliably implemented in practice because of timing and synchronous execution issues.
Preemptively giving them to any HTMLObjectElement, no matter if it's blocked or not, may have unwanted side effects, for example on scripts which use a try {} catch {} construct to tell if an object has been fully loaded, but we could try hoping that most of them use a saner (typeof obj.property != "undefined") or ("property" in obj) approach.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Post by al_9x »

Giorgio Maone wrote:
al_9x wrote: Any scripting of these plugins will result in uncaught exceptions that will disable lot's of code on the page, I can only see an upside in limiting such errors.
Giving it only to blocked objects only and their placeholders is a good idea, albeit not so easy to be reliably implemented in practice because of timing and synchronous execution issues.
That's what I had in mind, only blocked objects and their placeholders, not knowing the details, I thought it might be easy since you are intercepting their instantiation, and if it's not, then no big deal, flash/silverlight will do.
Giorgio Maone wrote:Preemptively giving them to any HTMLObjectElement
No, definitely not, I wasn't implying that.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Post by Giorgio Maone »

Please check latest development build, also against your UStream placeholder issue (I changed the timing of placeholder replacement, delaying it just after DOMDocumentLoad, therefore some time-related layout issues should be gone).
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Post by al_9x »

Giorgio Maone wrote:Please check latest development build, also against your UStream placeholder issue (I changed the timing of placeholder replacement, delaying it just after DOMDocumentLoad, therefore some time-related layout issues should be gone).
ustream problem is gone, can't repro after many reloads, can you say more about what you think was going on there?

__noSuchMethod__ patching is not working, I am getting:

Error: player_.pauseVideo is not a function
Source file: http://s.ytimg.com/yt/js/channel_legacy ... l152239.js
Line: 4072

when switching to grid layout in youtube channels
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Post by Giorgio Maone »

Please check latest development build 1.9.9.56, thanks.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Post by al_9x »

Giorgio Maone wrote:Please check latest development build 1.9.9.56, thanks.
fixed
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
Post Reply