External File Surrogates Not Working Correctly

Proposals for new surrogate scripts, updates/bug fixes to existing ones, tips and tricks to work around the lazy web.
Post Reply
TooCrooked
Posts: 19
Joined: Sun May 02, 2010 9:51 pm

External File Surrogates Not Working Correctly

Post by TooCrooked »

javascript in an external file is not being "reloaded"??? please see my video. it will answer ALL your questions.

http://youtu.be/ppcZ5piCUOY

why aren't scripts written to an external file reloading as expected???
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: External File Surrogates Not Working Correctly

Post by barbaz »

What if you clear the browser cache before reloading the page?

If that doesn't work you've probably found a bug in NoScript...
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 SeaMonkey/2.28
TooCrooked
Posts: 19
Joined: Sun May 02, 2010 9:51 pm

Re: External File Surrogates Not Working Correctly

Post by TooCrooked »

clearing results in the same issue. the changing of the source file has no effect on subsequent reloads.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: External File Surrogates Not Working Correctly

Post by barbaz »

OK I'm going to dig around in the source and see if I can produce a more detailed report.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 SeaMonkey/2.28
barbaz
Senior Member
Posts: 10847
Joined: Sat Aug 03, 2013 5:45 pm

Re: External File Surrogates Not Working Correctly

Post by barbaz »

I think what's happening is that NoScript is preloading the file at the time of surrogate creation rather than reading the file synchronously when it's needed, so if the file is changed externally NoScript won't know that anything happened.
I think that unfortunately for you, the way Giorgio has designed it is the best way performance-wise.

If you change the file, then make any changes to either surrogate pref (then change it back to what you want), do your changes to the file load?

I expect that in any case restarting the browser would get the new contents of the file.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 SeaMonkey/2.28
TooCrooked
Posts: 19
Joined: Sun May 02, 2010 9:51 pm

Re: External File Surrogates Not Working Correctly

Post by TooCrooked »

can we get him to comment on this to see if that's truth rather than your hunch?
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: External File Surrogates Not Working Correctly

Post by Giorgio Maone »

TooCrooked wrote:can we get him to comment on this to see if that's truth rather than your hunch?
That's exactly how it works. Otherwise it should perform blocking disk I/O every time a page which need a replacement is loaded, which is unacceptable performance-wise.
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
TooCrooked
Posts: 19
Joined: Sun May 02, 2010 9:51 pm

Re: External File Surrogates Not Working Correctly

Post by TooCrooked »

Thank you for confirming.

Would it be possible, for the purposes of debugging, for you to implement the ability to change some noscript about:config preference to allow synchronous loading of external files?

having to close and reopen the browser is beyond exceedingly tedious!
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: External File Surrogates Not Working Correctly

Post by Giorgio Maone »

TooCrooked wrote: having to close and reopen the browser is beyond exceedingly tedious!
You don't need to do that.
Just keep about:config open and modify any noscript.surrogate.* preference value to trigger a full reload.
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: External File Surrogates Not Working Correctly

Post by Thrawn »

The heavyweight approach, I guess, would be to set up a file monitor that would alert NoScript to any changes in the file. But that's very likely not worthwhile.
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:31.0) Gecko/20100101 Firefox/31.0
TooCrooked
Posts: 19
Joined: Sun May 02, 2010 9:51 pm

Re: External File Surrogates Not Working Correctly

Post by TooCrooked »

Giorgio Maone wrote:Just keep about:config open and modify any noscript.surrogate.* preference value to trigger a full reload.
?? what do you mean?
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
TooCrooked
Posts: 19
Joined: Sun May 02, 2010 9:51 pm

Re: External File Surrogates Not Working Correctly

Post by TooCrooked »

so you're saying i have to edit my file, then go into about config, change any random preference (double click, add info, click okay, switch back to tab, reload) to get "updates" to my file?

edit...

that's exactly what you're saying. 12 billion clicks, mousemovements and typing to get a file to reload. incredible!
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
TooCrooked
Posts: 19
Joined: Sun May 02, 2010 9:51 pm

Re: External File Surrogates Not Working Correctly

Post by TooCrooked »

well, in either case, it's not working reliably. it was working initially and then it just stopped working. ill illustrate later.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: External File Surrogates Not Working Correctly

Post by Thrawn »

TooCrooked wrote: that's exactly what you're saying. 12 billion clicks, mousemovements and typing to get a file to reload. incredible!
Giorgio already explained that automatically picking up the changes would be obscenely expensive.
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0
Post Reply