reload page hotkey that skips re-sending information

User Help for Mozilla Firefox
Post Reply
WindHeight
Posts: 156
Joined: February 8th, 2008, 3:05 am

reload page hotkey that skips re-sending information

Post by WindHeight »

I want to reload some pages while doing some dev work but if the page to reload is a submitted form, firefox will prompt me to re-send the form data if I press F5. Is there a hotkey to refresh the page without this prompt, so that firefox just goes to the same url again? I have to manually go to the url bar and hit enter to do this now.
User avatar
Grumpus
Posts: 13239
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: reload page hotkey that skips re-sending information

Post by Grumpus »

Maybe these links will help, I didn't see anything which would override the form rule on the Mozilla page but maybe somewhere in the dev page.
Mozilla Hot key page
Dev Hot keys
Just wondering why you couldn't leave the form open in a tab?
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
WindHeight
Posts: 156
Joined: February 8th, 2008, 3:05 am

Re: reload page hotkey that skips re-sending information

Post by WindHeight »

Thanks for the links, I will look at them.

I am a bit confused at what you are suggesting with having the form open in a tab. Maybe my situation wasn't clear. I am continuously submitting forms with new data/POST to debug them and test new features. Am I missing something?
User avatar
Grumpus
Posts: 13239
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: reload page hotkey that skips re-sending information

Post by Grumpus »

@WindHeight - No I did. I thought you wanted one instance of empty form page reloaded.
You might want to clear form history after each submission and save the basic blank form page link as a bookmark for the return.
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
WindHeight
Posts: 156
Joined: February 8th, 2008, 3:05 am

Re: reload page hotkey that skips re-sending information

Post by WindHeight »

I lowered it to two hotkeys based on the links you posted: F6 to select the location bar and then Enter. Would anyone have an idea on how to combine these two hotkeys to one hotkey?
User avatar
Grumpus
Posts: 13239
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: reload page hotkey that skips re-sending information

Post by Grumpus »

Does Windows still allow macros? maybe that way.
Otherwise some css code or script.
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
morat
Posts: 6405
Joined: February 3rd, 2009, 6:29 pm

Re: reload page hotkey that skips re-sending information

Post by morat »

You can reload the page with the keyconfig extension.

I don't know the code to reload the page without the prompt. I would have to test.

Code: Select all

gBrowser.loadURI(gBrowser.currentURI.spec);

Code: Select all

BrowserCharsetReload();

Code: Select all

BrowserReloadSkipCache();

Code: Select all

// same as BrowserReloadSkipCache()
var webNav = Components.interfaces.nsIWebNavigation;
var flags = webNav.LOAD_FLAGS_BYPASS_PROXY | webNav.LOAD_FLAGS_BYPASS_CACHE;
BrowserReloadWithFlags(flags);
Dorando keyconfig
http://addons.mozilla.org/en-us/firefox ... keyconfig/

nsIWebNavigation
http://developer.mozilla.org/en-US/docs ... Navigation
http://dxr.mozilla.org/mozilla-release/ ... gation.idl
WindHeight
Posts: 156
Joined: February 8th, 2008, 3:05 am

Re: reload page hotkey that skips re-sending information

Post by WindHeight »

morat wrote:You can reload the page with the keyconfig extension.

I don't know the code to reload the page without the prompt. I would have to test.

Code: Select all

gBrowser.loadURI(gBrowser.currentURI.spec);

Code: Select all

BrowserCharsetReload();

Code: Select all

BrowserReloadSkipCache();

Code: Select all

// same as BrowserReloadSkipCache()
var webNav = Components.interfaces.nsIWebNavigation;
var flags = webNav.LOAD_FLAGS_BYPASS_PROXY | webNav.LOAD_FLAGS_BYPASS_CACHE;
BrowserReloadWithFlags(flags);
Dorando keyconfig
http://addons.mozilla.org/en-us/firefox ... keyconfig/

nsIWebNavigation
http://developer.mozilla.org/en-US/docs ... Navigation
http://dxr.mozilla.org/mozilla-release/ ... gation.idl
Morat - the last one worked perfectly, thanks! Some of the others did too but did not work with all urls, like those with # anchor links in them.
WindHeight
Posts: 156
Joined: February 8th, 2008, 3:05 am

Re: reload page hotkey that skips re-sending information

Post by WindHeight »

Actually, I made a mistake! The first code sample did not ask to send post again but did not work with urls with a # in them - it would just go to the anchor element on the page rather than reloading it. I thought the last one did work but it was unfortunately just bad testing on my part, as it prompted to send POST again, too. The 2nd and 3rd also prompted to send POST again.

I am not familiar with the mozilla API (thanks for the links) and javascript is not my forte, although I can hack away at it. Is there a way to have the first one work with urls with a # in them?
morat
Posts: 6405
Joined: February 3rd, 2009, 6:29 pm

Re: reload page hotkey that skips re-sending information

Post by morat »

WindHeight wrote:Is there a way to have the first one work with urls with a # in them?
Try this:

Code: Select all

var uri = gBrowser.currentURI;
if (uri.hasRef) {
  gBrowser.loadURI(uri.specIgnoringRef);
  gBrowser.addEventListener("load", function () {
    gBrowser.removeEventListener("load", arguments.callee, true);
    gBrowser.loadURI(uri.spec);
  }, true);
} else {
  gBrowser.loadURI(uri.spec);
}
WindHeight wrote:I have to manually go to the url bar and hit enter to do this now.
Here is the "Paste & Go" command. (shown when right clicking the url bar)

Code: Select all

gURLBar.select();
goDoCommand("cmd_paste");
gURLBar.handleCommand();
Try this:

Code: Select all

gURLBar.select();
gURLBar.handleCommand();
I think the code would simulate a "manually go to the url bar and hit enter" action.
WindHeight
Posts: 156
Joined: February 8th, 2008, 3:05 am

Re: reload page hotkey that skips re-sending information

Post by WindHeight »

morat wrote:
WindHeight wrote:Is there a way to have the first one work with urls with a # in them?
Try this:

Code: Select all

var uri = gBrowser.currentURI;
if (uri.hasRef) {
  gBrowser.loadURI(uri.specIgnoringRef);
  gBrowser.addEventListener("load", function () {
    gBrowser.removeEventListener("load", arguments.callee, true);
    gBrowser.loadURI(uri.spec);
  }, true);
} else {
  gBrowser.loadURI(uri.spec);
}
WindHeight wrote:I have to manually go to the url bar and hit enter to do this now.
Here is the "Paste & Go" command. (shown when right clicking the url bar)

Code: Select all

gURLBar.select();
goDoCommand("cmd_paste");
gURLBar.handleCommand();
Try this:

Code: Select all

gURLBar.select();
gURLBar.handleCommand();
I think the code would simulate a "manually go to the url bar and hit enter" action.

Thanks Morat. It did indeed work this time.
morat
Posts: 6405
Joined: February 3rd, 2009, 6:29 pm

Re: reload page hotkey that skips re-sending information

Post by morat »

You're welcome.
Post Reply