diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp index ebc52118ef5f..b129e7b80ac9 100644 --- a/content/base/src/nsObjectLoadingContent.cpp +++ b/content/base/src/nsObjectLoadingContent.cpp @@ -1459,12 +1459,15 @@ nsObjectLoadingContent::UpdateObjectParameters(bool aJavaURI) } if (isJava && hasCodebase && codebaseStr.IsEmpty()) { - // Java treats an empty codebase as the document codebase, but codebase="" - // as "/" + // Java treats codebase="" as "/" codebaseStr.AssignLiteral("/"); // XXX(johns): This doesn't cover the case of "https:" which java would // interpret as "https:///" but we interpret as this document's // URI but with a changed scheme. + } else if (isJava && !hasCodebase) { + // Java expects a directory as the codebase, or else it will construct + // relative URIs incorrectly :( + codebaseStr.AssignLiteral("."); } if (!codebaseStr.IsEmpty()) {