javascript - Prevent Script from loading normally -
i creating chrome extension webpage. page has script execute changes way page displayed removing or emptying elements. found <script>
tag need delete or stop executing. there way load page memory, parse remove <script>
tag , load normally?
the way can remove code via javascript of yet use chrome inspector disable javascript , run following code.
var scripts = document.getelementsbytagname('script'); (i=0, max=scripts.length; < max; i++){ var currents = scripts[i]; var xinner = currents.innerhtml; if (xinner.indexof('jsmenu1') < 1){ currents.parentnode.removechild(currents); } }
strange request. work.
$(document).ready(function() { var $html = $('html'); var $script = $html.find('script#scripttoremove'); $script.remove(); var htmlstr = $html.html(); $html.html(htmlstr); });
Comments
Post a Comment