OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 if (SUCCEEDED(pFrameCollection->item(vIndex, vRetIndex, &pFrameDispatch))
&& pFrameDispatch) | 233 if (SUCCEEDED(pFrameCollection->item(vIndex, vRetIndex, &pFrameDispatch))
&& pFrameDispatch) |
234 { | 234 { |
235 CComQIPtr<IWebBrowser2> pFrameBrowser = pFrameDispatch; | 235 CComQIPtr<IWebBrowser2> pFrameBrowser = pFrameDispatch; |
236 if (pFrameBrowser) | 236 if (pFrameBrowser) |
237 { | 237 { |
238 std::wstring src; | 238 std::wstring src; |
239 CComBSTR bstrSrc; | 239 CComBSTR bstrSrc; |
240 if (SUCCEEDED(pFrameBrowser->get_LocationURL(&bstrSrc)) && bstrSrc) | 240 if (SUCCEEDED(pFrameBrowser->get_LocationURL(&bstrSrc)) && bstrSrc) |
241 { | 241 { |
242 src = std::wstring(bstrSrc,SysStringLen(bstrSrc)); | 242 src = std::wstring(bstrSrc,SysStringLen(bstrSrc)); |
243 UnescapeUrl(src); | |
244 } | 243 } |
245 if (!src.empty()) | 244 if (!src.empty()) |
246 { | 245 { |
247 TraverseDocument(pFrameBrowser, false, indent); | 246 TraverseDocument(pFrameBrowser, false, indent); |
248 } | 247 } |
249 } | 248 } |
250 } | 249 } |
251 } | 250 } |
252 } | 251 } |
253 | 252 |
(...skipping 29 matching lines...) Expand all Loading... |
283 // eg. gadgetzone.com.au | 282 // eg. gadgetzone.com.au |
284 if (BeginsWith(src, L"//")) | 283 if (BeginsWith(src, L"//")) |
285 { | 284 { |
286 src = L"http:" + src; | 285 src = L"http:" + src; |
287 } | 286 } |
288 // eg. http://w3schools.com/html/html_examples.asp | 287 // eg. http://w3schools.com/html/html_examples.asp |
289 else if (!(BeginsWith(src, L"http") || BeginsWith(src, L"res://"))) | 288 else if (!(BeginsWith(src, L"http") || BeginsWith(src, L"res://"))) |
290 { | 289 { |
291 src = L"http://" + m_domain + src; | 290 src = L"http://" + m_domain + src; |
292 } | 291 } |
293 UnescapeUrl(src); | |
294 | 292 |
295 // Check if Iframe should be traversed | 293 // Check if Iframe should be traversed |
296 if (OnIFrame(pFrameEl, src, indent)) | 294 if (OnIFrame(pFrameEl, src, indent)) |
297 { | 295 { |
298 CComQIPtr<IWebBrowser2> pFrameBrowser = pFrameDispatch; | 296 CComQIPtr<IWebBrowser2> pFrameBrowser = pFrameDispatch; |
299 if (pFrameBrowser) | 297 if (pFrameBrowser) |
300 { | 298 { |
301 TraverseDocument(pFrameBrowser, false, indent); | 299 TraverseDocument(pFrameBrowser, false, indent); |
302 } | 300 } |
303 } | 301 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 { | 457 { |
460 m_cacheIndexLast = 0; | 458 m_cacheIndexLast = 0; |
461 m_cacheDocumentHasFrames.clear(); | 459 m_cacheDocumentHasFrames.clear(); |
462 m_cacheDocumentHasIframes.clear(); | 460 m_cacheDocumentHasIframes.clear(); |
463 } | 461 } |
464 m_criticalSection.Unlock(); | 462 m_criticalSection.Unlock(); |
465 } | 463 } |
466 | 464 |
467 | 465 |
468 #endif // _PLUGIN_DOM_TRAVERSER_BASE_H_ | 466 #endif // _PLUGIN_DOM_TRAVERSER_BASE_H_ |
OLD | NEW |