Whats is the nature of the auto reload on permissions change

General discussion about the NoScript extension for Firefox
Post Reply
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Whats is the nature of the auto reload on permissions change

Post by al_9x » Thu Dec 17, 2009 1:14 am

1) is it equivalent to the default Fx F5? or a cache quickreload? or something else?
2) What is is the reason for the particular choice?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20

User avatar
Giorgio Maone
Site Admin
Posts: 8802
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Whats is the nature of the auto reload on permissions change

Post by Giorgio Maone » Thu Dec 17, 2009 1:17 am

al_9x wrote:1) is it equivalent to the default Fx F5? or a cache quickreload? or something else?

cache quickreload
al_9x wrote:2) What is is the reason for the particular choice?

Speed & convenience (e.g. in most cases form field filling is kept).
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729)

al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: Whats is the nature of the auto reload on permissions change

Post by al_9x » Thu Dec 17, 2009 2:24 am

Giorgio Maone wrote:
al_9x wrote:1) is it equivalent to the default Fx F5? or a cache quickreload? or something else?

cache quickreload

Are you sure? I tried to figure it out but couldn't hit any breakpoints in Main.js (do you have any tips for that?), but it seems that when you temp allow with auto reload, reloadWhereNeeded (LOAD_FLAGS_NONE) is called and not quickReload.

The reason I ask, is that I don't like auto reload and do it manually when needed, but if you are doing the quick and I, regular Fx reload, that's wasteful. So I was going to ask you to expose your reload through a button or something, so one could manually invoke it.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20

User avatar
Giorgio Maone
Site Admin
Posts: 8802
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Whats is the nature of the auto reload on permissions change

Post by Giorgio Maone » Thu Dec 17, 2009 6:25 pm

al_9x wrote:
Giorgio Maone wrote:
al_9x wrote:1) is it equivalent to the default Fx F5? or a cache quickreload? or something else?

cache quickreload

Are you sure?

Yes. reloadWhereNeeded() reloads every affected tab using the fastest method available for each (i.e. using history-bfcache when possible, cache otherwise and a regular reload if no cache data is available, e.g. after a POST request).
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729)

al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: Whats is the nature of the auto reload on permissions change

Post by al_9x » Thu Dec 17, 2009 8:57 pm

Giorgio Maone wrote:using the fastest method available


Can you expose your reload so it can be manually invoked on the active tab? You provide an option to disable auto reload, which is good, but doing the regular Fx reload manually wastes time and bandwidth.

Do you have any tips for being able to debug your Main.js? Half the time it doesn't even appear in the file list in venkman, and when it does, breakpoints in it that should be hit are not.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20

User avatar
Giorgio Maone
Site Admin
Posts: 8802
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Whats is the nature of the auto reload on permissions change

Post by Giorgio Maone » Thu Dec 17, 2009 9:39 pm

al_9x wrote:
Giorgio Maone wrote:using the fastest method available


Can you expose your reload so it can be manually invoked on the active tab? You provide an option to disable auto reload, which is good, but doing the regular Fx reload manually wastes time and bandwidth.

I could, but it's not a priority for obvious reasons.
Do you have any tips for being able to debug your Main.js? Half the time it doesn't even appear in the file list in venkman, and when it does, breakpoints in it that should be hit are not.

Venkman is currently too buggy to debug extensions which export XPCOM components.
Personally I patch my code "live" with debug statement by opening about:config and running this bookmarklet:

Code: Select all

javascript:(function()%20{%20var%20d%20=%20document;%20if%20(d.getElementById("src"))%20return;%20var%20dc%20=%20d.documentElement;%20while(dc.firstChild)%20dc.removeChild(dc.firstChild);%20var%20r%20=%20dc.appendChild(d.createElement("vbox"));%20r.flex=1;%20var%20t%20=%20d.createElement("textbox");%20t.setAttribute("multiline","true");%20t.id="src";t.setAttribute("value",%20'var%20CC=Components.classes,CI=Components.interfaces;\nvar%20ns=CC["@maone.net/noscript-service;1"].getService().wrappedJSObject;\nvar%20fg=CC["@maone.net/flashgot-service;1"].getService().wrappedJSObject;\nvar%20o%20=%20ns;\no.__parent__.eval(function()%20{\n\n\nalert("done")}.toSource())()');%20t.flex="1";t.style.fontFamily="Lucida%20Console,%20Courier";%20r.appendChild(t);%20var%20b%20=%20d.createElement("button");b.setAttribute("label","eval");b.setAttribute("oncommand",%20"eval(document.getElementById('src').value)");%20r.appendChild(b);%20})()
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729)

al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: Whats is the nature of the auto reload on permissions change

Post by al_9x » Fri Dec 18, 2009 4:29 am

Giorgio Maone wrote:I could, but it's not a priority for obvious reasons.

Sure, but keep it in mind please.
Giorgio Maone wrote:Personally I patch my code "live"

Thanks for the tip, definitely better than nothing. You'd think they'd have a working debugger by now. However I must be missing something. With your patching I am seeing that reloadWhereNeeded calls browser.webNavigation.reload with LOAD_FLAGS_NONE. Isn't that the same as regular Fx F5 reload?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20

User avatar
Giorgio Maone
Site Admin
Posts: 8802
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Whats is the nature of the auto reload on permissions change

Post by Giorgio Maone » Fri Dec 18, 2009 9:03 am

al_9x wrote:browser.webNavigation.reload with LOAD_FLAGS_NONE. Isn't that the same as regular Fx F5 reload?

Yes it is, but later (in a "http-on-modify-request" observer) the channel flags are forced to VALIDATE_NEVER, meaning that unless stuff had not been cached, the network is not hit. Just use HttpFox to compare a regular reload with a NoScript one.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729)

Post Reply