Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #15 from rainemak/fixLocationChanged
Call nsIEmbedBrowserChromeListener::OnLocationChanged with an exposable url
  • Loading branch information
tmeshkova committed May 13, 2014
2 parents 2604f74 + 0d53e45 commit 98b8897
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion embedding/embedlite/utils/WebBrowserChrome.cpp
Expand Up @@ -28,6 +28,7 @@
#include "nsIFocusManager.h"
#include "nsIDOMScrollAreaEvent.h"
#include "nsISerializable.h"
#include "nsIURIFixup.h"
#include "nsIEmbedBrowserChromeListener.h"
#include "nsIBaseWindow.h"

Expand Down Expand Up @@ -258,7 +259,18 @@ WebBrowserChrome::OnLocationChange(nsIWebProgress* aWebProgress,

nsCString spec;
if (location) {
location->GetSpec(spec);
nsCOMPtr<nsIURIFixup> fixup(do_GetService("@mozilla.org/docshell/urifixup;1"));
if (fixup) {
nsCOMPtr<nsIURI> tmpuri;
nsresult rv = fixup->CreateExposableURI(location, getter_AddRefs(tmpuri));
if (NS_SUCCEEDED(rv) && tmpuri) {
tmpuri->GetSpec(spec);
} else {
location->GetSpec(spec);
}
} else {
location->GetSpec(spec);
}
}
nsCString slocation(spec);
int32_t i = slocation.RFind("#");
Expand Down

0 comments on commit 98b8897

Please sign in to comment.