|
|
I see a lot of scripts that use two lines for HTTP and HTTPS requests, something like:
Now, I'll admit I have a problem. I love elegance and I just can't stop. I try to stay away, but I just keep reducing and purifying code until it's a work of art. So my question is: Can anyone think of a practical reason not to use "http*://foo.bar" instead? |
|
|
That is very elegant it works and given that grease monkey only works on a limited number of protocols, it should be impossible to spoof (though if your going to be that paranoid it should have a tailing slash). EDIT: should do my research this can be spoofed eg http://www.evil.com/steal://foo.barfor details see the Greasespot wiki |
|
|
This brings up an interesting point: what's the regex support for the includes/excludes? If it only supports *, then you're stuck with two... if it uses standard javascript regexes, you can do a single, optional character to handle it. -Joel |
|
|
Good call, Mr. Scum. I checked the wiki, but I didn't spend much time on it... I figured someone clever would be more thorough than myself. :) And Joel also raises a good point. I could think of some scripts that would be nice to run on things that match certain complicated patterns that involve "/forums/". |
|
|
* is not regex - that would be .* .
But since it supports the key "tld" it might be better to use keys like http(s), (domain) and (sub) for any or no subdomain
|
|
|
No regexp support, just the Full(er) regexp support or smarter wildcars have been discussed on the mailing list. Can't recall what happened with it; probably got bogged down in conflicting opinions, or no one has been inclined to write the code. |