Skip to content

Instantly share code, notes, and snippets.

@ryanseddon
Created December 12, 2011 04:45
Show Gist options
  • Select an option

  • Save ryanseddon/1464972 to your computer and use it in GitHub Desktop.

Select an option

Save ryanseddon/1464972 to your computer and use it in GitHub Desktop.
Extending modernizr core tests without changing the core
if(Modernizr.postmessage) {
// So we can extend it but still do `if(Modernizr.postmessage)`
Modernizr.postmessage = new Boolean(true);
Modernizr.postmessage.extend = function() {
// Do some tests
return bool;
}
}
@paulirish
Copy link
Copy Markdown

@ryanseddon
Copy link
Copy Markdown
Author

Well there you go, more thinking of external peeps extending core methods through plugins. Like all the legacy stuff should be plugins flexbox, gradients etc.

@paulirish
Copy link
Copy Markdown

Yeah.

I think that makes a lot of sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment