Page 1 of 1

NoScript toStaticHTML

Posted: Sat Jun 25, 2011 9:54 pm
by MetalArend
Been searching for hours now. I'm using Firebug and NoScript for years now. Last night in Firebug there showed up a piece of code in my script panel. I narrowed it down to NoScript (disabled all my add-ons, except of NoScript and Firebug, disabling NoScript disables the code from showing up in Firebug).

After a urldecode from the code showing up, this is the code I got:

javascript:try{window.toStaticHTML = function toStaticHTML(s) {
var t = document.createElement("toStaticHTML");
t.setAttribute("data-source", s);
document.documentElement.appendChild(t);
var ev = document.createEvent("Events");
ev.initEvent("NoScript:toStaticHTML", true, false);
t.dispatchEvent(ev);
return t.innerHTML;
}}catch(e){}
try{window.watch('ab',function(o,a,b){return a===false&&typeof(b)==='string'?false:b})}catch(e){}; void(0)

Why is this piece of code showing up in my Firebug? I never thought NoScript would ádd code? :P

Re: NoScript toStaticHTML

Posted: Sat Jun 25, 2011 10:14 pm
by Giorgio Maone

Re: NoScript toStaticHTML

Posted: Sun Jun 26, 2011 4:20 am
by MetalArend
Thanks, Giorgio, but I actually searched the forums and google before I posted here. ;-) I downloaded the latest normal version of firefox (instead of the beta), installed it (on my laptop, with a clean profile, instead of creating a portable version from the official install with the portable profile I normally use), installed the latest version from NoScript and Firebug (instead of the newest version from firebug, not yet published on the add-ons website), and did not install all my other add-ons, so I'm really honestly just trying to understand what is going on here... :D
So I'm curious to why my firebug keeps showing only this script, after a first time reloading my page. And why can't I use my firebug console any more (not even simply throwing a console.log message) once this code is listed in my javascript panel? Could be that it is a firebug problem, but still, never saw this code coming up before, untill yesterday night. So, is this actually a change from last night? And if, isn't there something going terribly wrong?

Try it yourself:
install firefox
install firebug and noscript
enable firebug, enable noscript
go to a webpage
enable all the scripts on that page
open up the firebug console, run the code "console.log('hello world');"
see the line "console.log('hello world')", followed by the line "hello world" in the console
reload the page
run the code "console.log('hello world');"
see only the line "console.log('hello world')"

Something definitely is going wrong :P

Re: NoScript toStaticHTML

Posted: Sun Jun 26, 2011 6:26 am
by Giorgio Maone
MetalArend wrote:Thanks, Giorgio, but I actually searched the forums and google before I posted here. ;-)
If you actually did, you'd already have known what toStaticHTML was.

MetalArend wrote: never saw this code coming up before, untill yesterday night.
Still I don't understand which version, exactly, is showing this behavior for you.
Could you check with latest development build?
MetalArend wrote: Try it yourself:
install firefox
install firebug and noscript
enable firebug, enable noscript
go to a webpage
enable all the scripts on that page
open up the firebug console, run the code "console.log('hello world');"
see the line "console.log('hello world')", followed by the line "hello world" in the console
reload the page
run the code "console.log('hello world');"
see only the line "console.log('hello world')"
It works for me (I get "hello world" also after reloading the page).
Tested on http://getfirebug.com/firstrun with Fx 5.0, NoScript 2.1.1.2rc9 and Firebug 1.7.3.

Re: NoScript toStaticHTML

Posted: Sun Jun 26, 2011 1:30 pm
by MetalArend
Giorgio Maone wrote:If you actually did, you'd already have known what toStaticHTML was.
Well, I understood that it was some kind of thing IE had, and even that you could check with it whether or not someone has firebug installed, which was kinda interesting (and disturbing at the same time), but my question still was/is: why was it never before showing up in my firebug, and now all for sudden is, as it was something that people have been talking about since like 2009... Sorry for my reaction though, it's not really useful while finding a solution ;)
Giorgio Maone wrote:Still I don't understand which version, exactly, is showing this behavior for you. Could you check with latest development build?
I'm running NoScript 2.1.1.1 and Firebug 1.7.3, on Firefox 5.0. Gonna download the latest rc, and coming back to you after that ;)
Giorgio Maone wrote:It works for me (I get "hello world" also after reloading the page).
Well, only thing to say now would be a real dutch "dedju", as this means it's not that easily reproducable as one would wish for. Let's see, gonna uninstall and remove all bits and pieces from NoScript and Firebug, and try this again. Wish me luck!

Re: NoScript toStaticHTML

Posted: Sun Jun 26, 2011 2:00 pm
by MetalArend
I uninstalled both, restarted twice, installed firebug, restarted twice, tried the console, reloaded page, retried the console, installed the latest dev build, restarted twice, tried the console, reloaded the page, tried the console again... No 'toStaticHTML' is showing up in my script console, and all is working fine...

Just out of curiosity I reinstalled the previous version of NoScript, and yep, there it is again: can log a console message as long as the script tab has not loaded the scripts. After reloading the page console logging is not working anymore. Installed the latest release candidate, rc9, and jup, fixes everything!

Thanks for the quick response, and as I never told you before, but thought it a lot already: great job with NoScript! I keep recommending it, as together with a few other add-ons, it keeps my firefox a safer place on earth :D