Index: src/plugin/PluginDomTraverserBase.h |
=================================================================== |
--- a/src/plugin/PluginDomTraverserBase.h |
+++ b/src/plugin/PluginDomTraverserBase.h |
@@ -237,9 +237,9 @@ |
{ |
std::wstring src; |
CComBSTR bstrSrc; |
- if (SUCCEEDED(pFrameBrowser->get_LocationURL(&bstrSrc)) && bstrSrc) |
+ if (SUCCEEDED(pFrameBrowser->get_LocationURL(&bstrSrc))) |
{ |
- src = std::wstring(bstrSrc,SysStringLen(bstrSrc)); |
+ src = ToWstring(bstrSrc); |
} |
if (!src.empty()) |
{ |
@@ -274,29 +274,31 @@ |
{ |
CComVariant vAttr; |
- if (SUCCEEDED(pFrameEl->getAttribute(ATL::CComBSTR(L"src"), 0, &vAttr)) && vAttr.vt == VT_BSTR && ::SysStringLen(vAttr.bstrVal) > 0) |
+ if (SUCCEEDED(pFrameEl->getAttribute(ATL::CComBSTR(L"src"), 0, &vAttr)) && vAttr.vt == VT_BSTR) |
{ |
- std::wstring src(vAttr.bstrVal, SysStringLen(vAttr.bstrVal)); |
+ std::wstring src = ToWstring(vAttr.bstrVal); |
+ if (!src.empty()) |
+ { |
+ // Some times, domain is missing. Should this be added on image src's as well?'' |
+ // eg. gadgetzone.com.au |
+ if (BeginsWith(src, L"//")) |
+ { |
+ src = L"http:" + src; |
+ } |
+ // eg. http://w3schools.com/html/html_examples.asp |
+ else if (!(BeginsWith(src, L"http") || BeginsWith(src, L"res://"))) |
+ { |
+ src = L"http://" + m_domain + src; |
+ } |
- // Some times, domain is missing. Should this be added on image src's as well?'' |
- // eg. gadgetzone.com.au |
- if (BeginsWith(src, L"//")) |
- { |
- src = L"http:" + src; |
- } |
- // eg. http://w3schools.com/html/html_examples.asp |
- else if (!(BeginsWith(src, L"http") || BeginsWith(src, L"res://"))) |
- { |
- src = L"http://" + m_domain + src; |
- } |
- |
- // Check if Iframe should be traversed |
- if (OnIFrame(pFrameEl, src, indent)) |
- { |
- CComQIPtr<IWebBrowser2> pFrameBrowser = pFrameDispatch; |
- if (pFrameBrowser) |
+ // Check if Iframe should be traversed |
+ if (OnIFrame(pFrameEl, src, indent)) |
{ |
- TraverseDocument(pFrameBrowser, false, indent); |
+ CComQIPtr<IWebBrowser2> pFrameBrowser = pFrameDispatch; |
+ if (pFrameBrowser) |
+ { |
+ TraverseDocument(pFrameBrowser, false, indent); |
+ } |
} |
} |
} |