Today, they seem to have automatically users in our area to .co.in so my
gm scripts stopped working. I have now included/ excluded both .com
and .co.in in headers like
// @include http://www.orkut.com/*
// @include https://www.orkut.com/*
// @exclude http://www.orkut.com/Privacy.aspx
// @exclude http://www.orkut.com/About.aspx
//
// @include http://www.orkut.co.in/*
// @include https://www.orkut.co.in/*
// @exclude http://www.orkut.co.in/Privacy.aspx
// @exclude http://www.orkut.co.in/About.aspx
is there any method of using wild cards so that both can be included/
excluded thru a single command like
// @include http://www.orkut.co*
or
// @include http://www.orkut.*
and can this wild card match leaving the last specified part? like
// @exclude http://www.orkut.co*/Privacy.aspx
or
// @exclude http://www.orkut.*/Privacy.aspx
Thanks.
--
Vikas
a different effect is that I had hard coded .com url in my code while I
was modifying the original url.
viewprofilelink.href="http://www.orkut.com/FullProfile.aspx"+"?"+linkparts[1];
But now, after it could be .co.in for me and .com for other users and
may be other .co.au or .co.uk for still other users, I can't hardcode
just .com.
So, now, how to I get the first part of the main url (the current page)
upto "http://www.orkut.com/" (or "http://www.orkut.co.in/" or whatever
equivalent) to some variable that I can then put in the code instead of
the fixed "http://www.orkut.com/".
thanks.
--
VIkas
yeah, * is working as wild character any number of times.
now, how to get the top level main part of a url that would include the tld:
if i[j].href has -> http://www.orkut.co.in/Home.aspx
then,
i[j].getAttribute("href")
/Home.aspx
i[j].href.indexOf(i[j].getAttribute("href"))
22
so, taking from start to the location of this href attribute will strip
the url and give the starting url including tld.
i[j].href.substring(0,i[j].href.indexOf(i[j].getAttribute("href")))
http://www.orkut.co.in
and if u want to include ending "/" also, then
i[j].href.substring(0,i[j].href.indexOf(i[j].getAttribute("href"))+1)
http://www.orkut.co.in/
Still, anyone having a better idea is welcome to share.
hope that helps.
--
Vikas
On 5/28/2008 2:50 PM India Time, _BD_ wrote:
> I hope I'm telling you the correct info here. (it's late and I'm tired)
>
> You can use as many "*" wildcards as you want in the include/exclude
> specifications. (for those more technical, all "*" characters are
> converted to ".*" as a regular expression part (which means "zero or
> more characters" — see Gm convert2RegExp.js) — it also slash-quotes the
> characters that need it, like periods and others)
>
> So I would think (without trying it) that the following will probably work:
>
> @include http*://www.orkut.co*/*
> and
> @exclude http*://www.orkut.co*/Privacy.aspx
>
> There may be some issues with greedy and non-greedy matching, but I
> would have to think about that harder. (this should also be mentioned
> and explained in the wiki help section that someone gave a link to)
>
> *It would be nice (and not too difficult, really) to make a utility that
> lets you run a URL against an include and exclude specification and tell
> you if you get a match or not.* (maybe there is one already; I've