modernizr

What is the current best-practice for using Content-Security-Policy with modernizr?

吃可爱长大的小学妹 提交于 2019-12-24 10:47:01
问题 We want to secure our site with Content-Security-Policy, and even with the setting of allowing inline scripts ( default-src 'self'; script-src 'self' 'unsafe-inline' ), loading modernizr (2.6.2) produces 4 CSP violations: I upgraded to the latest version (3.6.0), the develop version, and now it produces over 30 CSP violations: I couldn't find any official statement on CSP on the modernizr site, it merely mentions that in 2012, they added a detect for Content Security Policy (https://modernizr

Modernizr download file, but it is still undefined afterwards? (Only in IE9 after page postback)

半腔热情 提交于 2019-12-24 09:09:47
问题 I've got a jQuery plugin I made which will nicely format dates on elements with certain attributes on them. Overall it works, but I'm having some problems with Modernizr, but ONLY in IE and ONLY after a form postback. Here's a snippet from the plugin where it uses the fantastic MomentJS library. Basically the first time the plugin is called, it will download the needed file then run the code to parse dates. If it is called any time afterwards and the library has already been downloaded, it

YepNope key value pairs not executing as expected

时间秒杀一切 提交于 2019-12-24 05:22:09
问题 I am starting to learn YepNope and have a script like such: yepnope([ { load: 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', }, { test: true, yep: { 'jquery-ui' : 'js/jquery-ui.js', 'jquery-expandable' : 'js/jquery.expandable.js', 'triggers' : 'js/triggers.js', 'prettify' : 'js/prettify/prettify.js' }, callback: { 'prettify': function (url, result, key) { console.log(key + ' loaded ' + result); prettyPrint(); } } } ]); I only need a callback for prettify. However running

Modernizr a-download for download attribute does not work in IE, Safari and and Opera?

淺唱寂寞╮ 提交于 2019-12-24 03:45:07
问题 I downloaded this Modernizr snippet http://modernizr.com/download/#-a_download (found under Non-core detects) and added it in the <head> . My html markup looks like this: <a href="test.jpg" download="test.jpg">Download file</a> In Firefox and Chrome, download attribute is supported even without using Modernizr. Modernizr's a-download is not supported by IE, Safari and Opera? Has anyone tried this before and got this working some other way? 来源: https://stackoverflow.com/questions/18681644

HTML5 Boilerplate + Media Queries not working in IE8?

痴心易碎 提交于 2019-12-23 19:09:16
问题 Since Boilerplate has respond.js built-in, it should in theory be able to support following css: @media only screen and (max-height: 580px){.rnd-class{:height:200px !important;}} In FF and Chrome, it works as expected and the custom styles kick in after resizing the browser window. However, in IE8 the custom styles are always enabled - no matter how big the current browser window is. I was thinking that the problem is inside my code somewhere, but than I visited the Boilerplate mobile

layout-lt-mdhas been deprecated. Please use a `layout-gt-<xxx>` variant

若如初见. 提交于 2019-12-23 19:04:12
问题 I'm writing angular program. I use angular and http://materializecss.com/ This console logs: layout-lt-mdhas been deprecated. Please use a `layout-gt-<xxx>` variant. angular.js:13424 layout-lt-lghas been deprecated. Please use a `layout-gt-<xxx>` variant. angular.js:13424 flex-lt-mdhas been deprecated. Please use a `flex-gt-<xxx>` variant. angular.js:13424 flex-lt-lghas been deprecated. Please use a `flex-gt-<xxx>` variant. angular.js:13424 layout-align-lt-mdhas been deprecated. Please use a

How to add CSS3 rounded corners with modernizr?

自古美人都是妖i 提交于 2019-12-23 03:29:07
问题 I am trying to add CSS3 based rounded corner support in IE7 and IE8 on following page Test URL: http://jaspreetkaur.com/postjoint I have included modernizr library, but it's not working. Is there any code that i need add to make it working in IE? 回答1: As others have said, Modernizr won't make legacy browsers able to support CSS3. It only checks for support, plus other neat features, such as HTML5shiv, so that you can use HTML5 markup. To enable CSS3 features in older browsers, you might try

Detect viewport units (with modernizr or normal js) and serve appropriate stylesheet

房东的猫 提交于 2019-12-22 12:19:33
问题 I actually have an issue im trying to solve since 3 weeks. Im trying to test support for vw units and serve a seperate stylesheet when the browser doesnt support the unit I read the modernizr tutorials and am familiar with modernizr css detects but testing for vh units (viewport relative units) is something I didnt find on the net. So basically: Scenario 1: Browser supports vw unit then serve stylesheet A. Scenario 2: Browser doesnt support it then serve stylesheet B. I did find out that

Detect data URI in links support with Modernizr

醉酒当歌 提交于 2019-12-22 08:21:10
问题 Using data URI in links ( <a href="data: ) is not supported in IE and Microsoft Edge (Data URI link <a href="data: doesn't work in Microsoft Edge). I'm trying to use Modernizr to detect data URI in links support. Modernizr.datauri is not quite what I'm looking for, as it does not tell anything about support data URI in links, e.g. for Microsoft Edge it returns object {over32kb: true} How can I detect using Modernizr if data URI in links is supported in browser? 回答1: I had the same need for

Using Modernizr library, why does it add classes to the html tag

家住魔仙堡 提交于 2019-12-22 07:01:08
问题 Can anyone explain (because the github page doesn't) why Modernizr feels the need to add all of those classnames to the HTML tag ? After loading Modernizr, it looks like this: <!doctype html> <html class=" js flexbox canvas canvastext webgl ~~~~ etc etc I see no explanation at all why it wants to do that. Modernizr provides properties to let me know whether for example canvas is supported (Modernizr.canvas == true?). Are those html classnames added for a test that's easier than that? 回答1: