[Javascript] Script removed by snapshot save in Firefox

Alberto Domingo alberto.domingo at uah.es
Wed Jan 5 10:19:45 CST 2011


Hi David,

I do nothing special.
Just copy this code, save as html and run it in FF.
Push the button and save the generated page. Then look at the 
contents. Everything is there.

BTW, my problem was NoScript. It is now solved.


Code:


<html>
<body>
<script type="text/javascript">
function generatepage(){
var t = "";
t += "<HTML>\r";
t += "<HEAD>\r";
t += "<TITLE>";
t += "GENERATED PAGE";
t += "</TITLE>\r";
t += "<scr"+"ipt type='text/javascript' src='somescript.js'>\r";
t += "</scr"+"ipt>\r";
t += "<scr"+"ipt type='text/javascript'>\r";
t += "var a = 1;";
t += "</scr"+"ipt>\r";
t += "</HEAD>\r";
t += "<BODY>\r";
t += "Save this page and look at the saved code. Also in the 
associated folder, look at the scripts."
t += "<scr"+"ipt type='text/javascript' src='otherscript.js'>\r";
t += "</scr"+"ipt>\r";
t += "</BODY>\r";
t += "</HTML>\r";
var W=window.open('',(new Date()).getTime());
W.document.write(t);
W.document.close();
}
</script>
<input type="button" onclick="generatepage();" value="make test page">
</body>
</html>




At 20:17 04/01/2011, you wrote:
>On 1/3/11 5:00 AM, Alberto Domingo wrote:
>[...]
>>
>>I use firefox because the generated code can be saved and creates a
>>working page. I use to create not only the html code but also
>>javascript scripts, I have been doing this for years, and everything
>>was perfect, but for some reason (update? Plugins? Complements?) now
>>the contents of the script tag is replaced by this text:
>>
>>/* Script removed by snapshot save */
>
>How did you manage to save code generated by JavaScript? Are you using
>some add-on I don't know about? The only way I get to see generated code
>is by using Chris Pederick's Web Developer toolbar-- and that does not
>show a complete page, as many elements in the <head> are left out.
>
>>The same happens when I save any page. I used to save all (at least
>>many) scripts present or called in the page, but not any more.
>
>FWIW - I use the "Save Complete"[1] add-on to save everything, including
>scripts inside Conditional Comments. But this does not necessarily give
>a working set of files. If your scripts include a path to resources, for
>example, it will fail because all resources are placed in a single
>directory... :(
>
>[1] <https://addons.mozilla.org/en-US/firefox/addon/4723/>
>
>Cordially,
>David
>--
>_______________________________________________
>Javascript mailing list
>Javascript at lists.evolt.org
>http://lists.evolt.org/mailman/listinfo/javascript



More information about the Javascript mailing list