0

I am trying to make a bookmarklet, which will be used only in Firefox 3. I want it to do one thing if the page it is used on was the result of a GET request, and another thing if it was produced after submitting a POST request. Specifically, I am trying to determine whether I can pull up the same page by accessing the URL that is in the address bar. Something like this:

if (whatever) {
    alert("This page was produced by a get request.");
} else {
    alert("This page was produced by a post request.");
}

I just need to know how to test for it.

Elias Zamaria
  • 96,623
  • 33
  • 114
  • 148

2 Answers2

1

I don't know of a way for you to do this as a bookmarklet, but there is a Firefox addin that can give you this information - http://livehttpheaders.mozdev.org/ You could take a look at the source of that add-in and see if you can modify it to create your own add-in to do what you want based off of their code.

garethm
  • 2,163
  • 17
  • 27
  • Thank you. I don't know much about Firefox add-ons, but I may try this if I find the time and willingness to experiment. – Elias Zamaria Jun 23 '09 at 23:28
0

I'm pretty sure javascript can't detect what HTTP verb was used.

Spencer Ruport
  • 34,865
  • 12
  • 85
  • 147