a53b9958fa734f73aeffb9ddfe2fbad1ca65f90c galt Mon Jan 30 16:18:41 2017 -0800 Check-in of CSP2 Content-Security-Policy work. All C-language CGIs should now support CSP2 in browser to stop major forms of XSS javascript injection. Javascript on pages is gathered together, and then emitted in a single script block at the end with a nonce that tells the browser, this is js that we generated instead of being injected by a hacker. Both inline script from script blocks and inline js event handlers had to be pulled out and separated. You will not see js sprinkled through-out the page now. Older browsers that support CSP1 or that do not understand CSP at all will still work, just without protection. External js libraries loaded at runtime need to be added to the CSP policy header in src/lib/htmshell.c. diff --git src/hg/js/subCfg.js src/hg/js/subCfg.js index 1221ed5..ad712cb 100644 --- src/hg/js/subCfg.js +++ src/hg/js/subCfg.js @@ -841,35 +841,35 @@ } }); // Tricky for composite level controls. Could wrap cfg controls in new div. // DO THIS AFTER Views // NOTE: excluding sortOrder and showCfg which are special cases we don't care about here // Excluding views and subCBs because a {composite}_{subtrack} naming scheme may be used var compObjs = $('select,input').filter("[name^='"+subCfg.compositeName+"\\.'],[name^='"+ subCfg.compositeName+"_']"); // viewDD, subCB already done. non-abc matCBs not needed, as they shouldn't go to the cart.! compObjs = $(compObjs).not(".viewDD,.subCB,.matCB:not(.abc)"); if (compObjs.length > 0) { $(compObjs).each(function (i) { if (this.type !== 'hidden') { // DEBUG ------------- - if (this.id && this.id.length > 0 - && $(this).hasClass('filterBy') === false - && $(this).hasClass('filterComp') === false) - warn('DEBUG: Unexpected control with name ['+this.name + '], and id #'+ - this.id); + //if (this.id && this.id.length > 0 + //&& $(this).hasClass('filterBy') === false + //&& $(this).hasClass('filterComp') === false) + // warn('DEBUG: Unexpected control with name ['+this.name + '], and id #'+ this.id); + $(this).change(function (e) { subCfg.markChange(e,this); subCfg.propagateSetting(this); }); } }); } // Bugfix #8048: Tim suggested using a special class to handle subtrack settings // that appear alongside composite settings, as in ldUi (HapMap LD). var subsInComp = $('select.subtrackInCompositeUi,input.subtrackInCompositeUi'); $(subsInComp).each( function(ix, el) { $(el).change(function(e) { subCfg.markChange(e, el); } ); }); // Because of fauxDisabled subCBs, it is necessary to truly disable them before submitting. $("FORM").submit(function (i) { // shadows will go to cart as they should