To main page | Opera Unite HowTo'sURLsSee Uniteness for better way to handle URLs. Basically URLs that you can use are fixed format: http://[computer_name].[your_opera_login].operaunite.com/[application] http://[computer_name].[your_opera_login].operaunite.com/[application]/[page][computer_name] is the name you gave your computer when installing Opera Unite. [your_opera_login] is the login to your Opera account. [application] is the name of the service defined in config.xml. [page] is what you define below: Brackets ([]) added for clarity, URLs don't include those. Then you define in your service: window.onload = function () {
webserver = opera.io.webserver
if (webserver) {
webserver.addEventListener('_index', start_page, false);
webserver.addEventListener('other', other_page, false);
// webserver.addEventListener('_request', all_requests, false);
// webserver.addEventListener('_close', onunload, false);
// [1]
}
}
function start_page(r) { // http://..../[application]/
// ....
}
function other_page(r) { // http://..../[application]/other/
// ....
}
start_page will be called at http://....operaunite.com/application/other_page will be called at http://....operaunite.com/application/other/ If you enable '_request' - any request will call that (see below for "User-friendly URLs"). Don't forget to enable webserver library in your config.xml. In UnitenessURLs([
'_index', start_page,
'edit', edit_item,
'imgs', 'static',
]);
User-friendly URLsIt seems somewhat user-friendly URLs are POSSIBLE. Digging request hierarchy I've discovered variable:r.connection.request.uri = "/[service_path]/delete?get_param=get_value"The "/[service_path]/delete?get_param=get_value" is the analogous to $_SERVER[REQUEST_URI] in PHP, which means you can process it yourself. You need to hook into '_request' URL instead of '_index'. [See URLs about 'hooking'] Domains (your-name.com)Originally I thought that using CNAME would be possible, but after a test I have to admit that CNAMEs don't work.You can still have a domain point to your Unite browser, but you need a registrar that supports framed domains or URL redirects. Many browsers (NameCheap and Dynadot for sure) support this option. Just setup your domain to be a redirect to your Opera Unite URL. | Last updated
|