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/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index 76eef91..8162e6c 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -714,31 +714,34 @@ // but in virtMode we may be in a window that is smaller than the ideo width // so temporarily set them to the actual ideo graphic offset and width int saveInsideX = insideX; int saveInsideWidth = insideWidth; insideX = textWidth+4; insideWidth = ideoWidth-insideX; ideoTrack->drawItems(ideoTrack, winStart, winEnd, hvg, insideX, gfxBorder, insideWidth, font, ideoTrack->ixColor, ideoTrack->limitedVis); insideX = saveInsideX; insideWidth = saveInsideWidth; hvGfxUnclip(hvg); /* Save out picture and tell html file about it. */ hvGfxClose(&hvg); /* Finish map. */ if (!psOutput) + { hPrintf("\n"); + jsInline("$('area.cytoBand').click(function(){return false;});\n"); + } } // create an empty hidden-map place holder which can change dynamically with ajax callbacks. if (!doIdeo && !psOutput) { hPrintf("\n"); } hPrintf("