Page 1 of 1

URI

Posted: Sat Apr 30, 2011 11:19 pm
by Netsu
Please add to custom action syntax parameter {uri} and domain name without www.

Re: URI

Posted: Sun May 01, 2011 6:32 pm
by DaveG
There are already parameters that do what you ask. The {fullURL} placeholder gives the full URL of the page and the {baseDomainName} placeholder gives the domain name without the "www" subdomain. (both are available in Flagfox 4.0+)

If these aren't enough for what action you're trying to write, please elaborate.

Re: URI

Posted: Sun May 01, 2011 11:00 pm
by Netsu
{fullURL} now (example):
http://flagfox.servehttp.com/forum/view ... ?f=5&t=325
I need uri of this page:
forum/viewtopic.php?f=5&t=325
Or tip for make two urls:
www.flagfox.servehttp.com/forum/viewtopic.php?f=5&t=325
and
flagfox.servehttp.com/forum/viewtopic.php?f=5&t=325
With uri it's will:
www.{baseDomainName}/{uri}
and
{baseDomainName}/{uri}

Re: URI

Posted: Mon May 02, 2011 6:32 am
by DaveG
Netsu wrote:{fullURL} now (example):
http://flagfox.servehttp.com/forum/viewtopic.php?f=5&t=325
I need uri of this page:
forum/viewtopic.php?f=5&t=325
Or tip for make two urls:
http://www.flagfox.servehttp.com/forum/viewtopic.php?f=5&t=325
and
flagfox.servehttp.com/forum/viewtopic.php?f=5&t=325
With uri it's will:
www.{baseDomainName}/{uri}
and
{baseDomainName}/{uri}
In this context URI is a synonym for URL. (URI article on Wikipedia; diagram in MDC article) You're not asking for a parameter for the URI, you're asking for a parameter for the path.

In that case, I don't see how a parameter for the path would be particularly useful. Could you please provide an example use case?

Note also that {baseDomainName} for this domain will be "servehttp.com" (a free DNS provider) not "flagfox.servehttp.com". The "www" on the front of a domain name is not special; it's just a subdomain and done these days more or less because people are used to it.

Re: URI

Posted: Sun Jul 17, 2011 12:46 pm
by Roman0
Here is an example of when the path part can be useful:
http://flagfox.servehttp.com.nyud.net/f ... ?f=5&t=325
See the description http://www.coralcdn.org

Re: URI

Posted: Sun Jul 17, 2011 1:40 pm
by Roman0
Never mind, javascript:window.location="http://{domainName}.nyud.net"+window.location.pathname+window.location.search does the job. Thank you! )

PS You can also use window.open(...) instead of window.location= to open in new tab/window. Also, javascript:window.location=window.location.protocol+"//{domainName}.nyud.net"+window.location.pathname+window.location.search doesn't help with https because there is no SSL on nyud.net

Re: URI

Posted: Sun Jul 17, 2011 9:37 pm
by DaveG
Roman0 wrote:Never mind, javascript:window.location="http://{domainName}.nyud.net"+window.location.pathname+window.location.search does the job. Thank you!
Yep, Flagfox 4.1+ lets you do things like this rather easily. Thanks for posting that.

You can actually do it a little simpler as Flagfox 4.1+ JavaScript actions have the content window object usable implicitly as if it were running in the content (though it's actually executed in a separate sandbox). So, you can drop all the usages of "window." to simplify things:

Code: Select all

javascript:location="http://{domainName}.nyud.net"+location.pathname+location.search
Roman0 wrote:PS You can also use window.open(...) instead of window.location= to open in new tab/window.
I don't think I documented this anywhere, but JS actions have access to a few extra functions. You can use the "openURL()" function to open a URL using the method set in the Flagfox options dialog used for normal URL-based actions:

Code: Select all

javascript:openURL("http://{domainName}.nyud.net"+location.pathname+location.search)

Re: URI

Posted: Mon Jul 18, 2011 7:30 am
by Roman0
Even better! Great application, thank you very much!