Skip to content

Instantly share code, notes, and snippets.

@hnrch02
Created February 18, 2014 11:08
Show Gist options
  • Save hnrch02/9068888 to your computer and use it in GitHub Desktop.
Save hnrch02/9068888 to your computer and use it in GitHub Desktop.
Blob feature detection with jQuery (see https://github.com/twbs/bootstrap/pull/12773)
+function() {
/**
* Based on:
* Blob Feature Check v1.0.0
* https://github.com/ssorallen/blob-feature-check/
* License: Public domain (http://unlicense.org)
*/
var url = window.webkitURL || window.URL // Safari 6 uses "webkitURL".
var svg = new Blob(
['<svg xmlns="http://www.w3.org/2000/svg"></svg>'],
{ type: 'image/svg+xml;charset=utf-8' }
)
$('<img>')
.on('error', function() {
$('.bs-docs-section, .bs-docs-sidebar').css('display', 'none')
showCallout('Looks like your current browser doesn\'t support the Bootstrap Customizer. Please take a second ' +
'to <a href="https://www.google.com/intl/en/chrome/browser/">upgrade to a more modern browser</a>.', true)
})
.on('load', function() {
$compileBtn.prop('disabled', false)
})
.attr('src', url.createObjectURL(svg))
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment