List Info

Thread: Document status code?




Document status code?
user name
2006-08-01 23:48:00
Is there a way to detect the status code?  I.E. Given a
script with 
"include *" let it ensure the response was a 200
OK before it does its 
thing?
_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
Document status code?
user name
2006-08-02 00:17:23
Not that I know of.

On 8/1/06, Anthony Lieuallen <arantiusgmail.com> wrote:
> Is there a way to detect the status code?  I.E. Given a
script with
> "include *" let it ensure the response was
a 200 OK before it does its
> thing?
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkeymozdev.org
> http:
//mozdev.org/mailman/listinfo/greasemonkey
>
_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
Document status code?
user name
2006-08-02 08:53:04
Best chance (afaik) is to check out Chris Pederick's Web
Developer 
Extension(s) at
http://ch
rispederick.com/work/webdeveloper/
and see how his View Response Headers function(s) work(s)
and then 
incorporate
that into a compiled into an extension GmScript.
Or something along those lines.
(you could add a/some function/s to Gm to return that info
for everyone 
to use,
or just you in your modified version so that your GmScript
will work)

Anthony Lieuallen wrote:
> Is there a way to detect the status code?  I.E. Given a
script with 
> "include *" let it ensure the response was
a 200 OK before it does its 
> thing?
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkeymozdev.org
> http:
//mozdev.org/mailman/listinfo/greasemonkey
>
_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
Document status code?
user name
2006-08-02 10:15:57
How about a quick XHR to the pages URL? XHR (native at
least) exposes
the response status code.
A simple HEAD request should do the trick.

Anthony Lieuallen schreef:
> Is there a way to detect the status code?  I.E. Given a
script with
> "include *" let it ensure the response was
a 200 OK before it does its
> thing?
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkeymozdev.org
> http:
//mozdev.org/mailman/listinfo/greasemonkey
>
_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
Document status code?
user name
2006-08-04 04:16:08
On 8/1/06, Anthony Lieuallen <arantiusgmail.com> wrote:
> Is there a way to detect the status code?

headers.response gives the full response line (i.e.
"HTTP/1.1 200 OK"
rather than just 200).
_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
Document status code?
user name
2006-08-04 06:01:47
Lenny Domnitser wrote:
> headers.response gives the full response line

iif you have Live HTTP Headers installed, right?

Phil Ringnalda
_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
Document status code?
user name
2006-08-04 06:44:09
"iff" -- that is AWESOME!

(I'm just sayin')

;o)

[[ iff = if and only if (in some programming languages), for
those who 
may not be familiar ]]

I think we're talking about "pure" Javascript
here.
"Unadulterated" in-browser client-side, GmScript
sandbox, and 
extension(Chrome)-extended/enhanced.
Altho, if there is an extension that allows access to that
info (like 
Web Developer Extensions, or
Live HTTP Headers, with which I am unfamiliar), then that
would be a 
possible way to go.

It's probably a failing of the "standard" to
not offer that info via JS, 
or the DOM, or something like that.
You can get some info, like referrer, but not other info,
like, 
unfortunately, some of the header data.
(like the response code) I can't think of a good reason why
it shouldn't 
allow access to that info, anyway.

Phil Ringnalda wrote:
 > Lenny Domnitser wrote:
 >> headers.response gives the full response line
 >
 > iif you have Live HTTP Headers installed, right?
 >
 > Phil Ringnalda

_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
Document status code?
user name
2006-08-04 16:04:58
On 8/4/06, Phil Ringnalda <philringnaldagmail.com> wrote:
> iif you have Live HTTP Headers installed, right?

I had no idea, but you're right. The name window.headers
doesn't
suggest it, but an extension is in fact required.
_______________________________________________
Greasemonkey mailing list
Greasemonkeymozdev.org
http:
//mozdev.org/mailman/listinfo/greasemonkey
[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )