pah. morning brain. thanks so much stu


On Tue, Mar 4, 2014 at 9:43 AM, Stu Cox <notifications@github.com> wrote:

> In feature-detects/custom-protocol-handler.js:
>
> >
> >  */
> >  define(['Modernizr'], function( Modernizr ) {
> > -  Modernizr.addTest('customprotocolhandler', !!navigator.registerProtocolHandler);
> > +  Modernizr.addTest('customprotocolhandler', function() {
> > +    // early bailout where it doesn't exist at all
> > +    if ( !navigator.registerProtocolHandler ) return false;
> > +
> > +    // registerProtocolHandler was stubbed in webkit for a while, and didn't
> > +    // actually do anything. We intentionally set it improperly to test for
> > +    // the proper sort of failure
> > +    try {
> > +      navigator.registerProtocolHandler('thisShouldFail');
> > +    }
> > +    catch (e) {
> > +      return e instanceof TypeError;
> > +    }
> > +
>
> Fancy sticking a return false; here, just in case some browser for some
> reason doesn't throw an error on L32?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/Modernizr/Modernizr/pull/992/files#r10265252>
> .
>



-- 
patrick