mirror of
https://github.com/servo/servo.git
synced 2025-07-04 05:53:39 +01:00
5 lines
No EOL
357 B
JavaScript
5 lines
No EOL
357 B
JavaScript
buildSiblingPath = function(hostPrefix, relativePath, newPort) {
|
|
var port = newPort ? newPort : document.location.port;
|
|
var path = document.location.pathname.substring(0, document.location.pathname.lastIndexOf('/') + 1);
|
|
return (document.location.protocol + '//' + hostPrefix + "." + document.location.hostname + ':' + port + path + relativePath);
|
|
}; |