@@ -13,13 +13,9 @@ var localStorageHandler = function(mustRemove) {
1313 }
1414} ;
1515
16- //=======================[ Bugged Noscript Workaround ]=======================/ /
16+ /*------------[ Unrendered Noscript (because CSP) Workaround ]----------------* /
1717
18- // If script is whitelisted, fixNoscriptTags() is not called. No need to
19- // mess with <noscript>
20- // If script is blacklisted, fixNoscriptTags() replaces the bugged <noscript>
21- // with a <div>, which can render HTML if needed.
22- var doNoscriptWorkaround = function ( ) {
18+ var fixNoscriptTags = function ( ) {
2319 var a = document . querySelectorAll ( 'noscript' ) ;
2420 var i = a . length ;
2521 var realNoscript ,
@@ -37,35 +33,18 @@ var doNoscriptWorkaround = function() {
3733
3834var checkScriptBlacklistedHandler = function ( response ) {
3935 if ( response . scriptBlacklisted ) {
40- doNoscriptWorkaround ( ) ;
36+ fixNoscriptTags ( ) ;
4137 }
4238}
4339
4440// Checking to see if script is blacklisted
41+ // Not sure if this is right place to check. I don't know if subframes with
42+ // <noscript> tags will be fixed. Should I call this from loadHandler() where
43+ // the old fixNoscriptTags() was called?
4544chrome . runtime . sendMessage ( { what : 'checkScriptBlacklisted' ,
4645 url : window . location . href
4746 } , checkScriptBlacklistedHandler ) ;
4847
49- //============================================================================//
50-
51- /*----------------------------------------------------------------------------*/
52-
53- //// This is to take care of
54- //// https://code.google.com/p/chromium/issues/detail?id=232410
55- //// We look up noscript tags and force the DOM parser to parse
56- //// them.
57- //var fixNoscriptTags = function() {
58- // var a = document.querySelectorAll('noscript');
59- // var i = a.length;
60- // var html;
61- // while ( i-- ) {
62- // html = a[i].innerHTML;
63- // html = html.replace(/</g, '<');
64- // html = html.replace(/>/g, '>');
65- // a[i].innerHTML = html;
66- // }
67- //};
68-
6948/*----------------------------------------------------------------------------*/
7049
7150var collectExternalResources = function ( ) {
0 commit comments