diff --git a/netwerk/protocol/res/nsResProtocolHandler.cpp b/netwerk/protocol/res/nsResProtocolHandler.cpp index 48a42287b9b1..26c11ae4062f 100644 --- a/netwerk/protocol/res/nsResProtocolHandler.cpp +++ b/netwerk/protocol/res/nsResProtocolHandler.cpp @@ -76,6 +76,7 @@ static nsResProtocolHandler *gResHandler = nsnull; static PRLogModuleInfo *gResLog; #endif +#define kAPP NS_LITERAL_CSTRING("app") #define kGRE NS_LITERAL_CSTRING("gre") //---------------------------------------------------------------------------- @@ -180,6 +181,12 @@ nsResProtocolHandler::Init() rv = SetSubstitution(EmptyCString(), uri); NS_ENSURE_SUCCESS(rv, rv); + // + // make resource://app/ point to the application directory or omnijar + // + rv = SetSubstitution(kAPP, uri); + NS_ENSURE_SUCCESS(rv, rv); + // // make resource://gre/ point to the GRE directory // diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp index f98a798d3908..2793f8bfb8da 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp @@ -301,9 +301,6 @@ nsXREDirProvider::GetFile(const char* aProperty, PRBool* aPersistent, if (NS_SUCCEEDED(rv)) file = lf; } - else if (!strcmp(aProperty, "resource:app")) { - rv = GetAppDir()->Clone(getter_AddRefs(file)); - } else if (!strcmp(aProperty, NS_APP_PROFILE_DIR_STARTUP) && mProfileDir) { return mProfileDir->Clone(aFile);