Calculate relative urls correctly when using chrome-extension://app-id/ as a base path