function resolveResourcePath(uri) {
  const handler = Services.io.getProtocolHandler("resource")
        .QueryInterface(Ci.nsIResProtocolHandler);
  const resolved = handler.resolveURI(Services.io.newURI(uri));
  return resolved.replace(/file:\/\//, "");
}