Page 1 of 1

__noSuchMethod__ for blocked dummy nodes and placeholders

Posted: Sun Mar 14, 2010 4:23 am
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?

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Posted: Sun Mar 14, 2010 8:58 am
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.

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Posted: Sun Mar 14, 2010 9:08 am
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?

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Posted: Sun Mar 14, 2010 9:18 am
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.

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Posted: Sun Mar 14, 2010 9:27 am
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.

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Posted: Sun Mar 14, 2010 9:43 am
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.

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Posted: Sun Mar 14, 2010 10:01 am
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.

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Posted: Sun Mar 14, 2010 4:36 pm
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).

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Posted: Sun Mar 14, 2010 6:34 pm
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

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Posted: Sun Mar 14, 2010 11:46 pm
by Giorgio Maone
Please check latest development build 1.9.9.56, thanks.

Re: __noSuchMethod__ for blocked dummy nodes and placeholders

Posted: Mon Mar 15, 2010 1:20 am
by al_9x
Giorgio Maone wrote:Please check latest development build 1.9.9.56, thanks.
fixed