LEFT | RIGHT |
1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
2 | 2 |
3 #include "PluginWbPassThrough.h" | 3 #include "PluginWbPassThrough.h" |
4 #include "PluginClient.h" | 4 #include "PluginClient.h" |
5 #include "PluginClientFactory.h" | 5 #include "PluginClientFactory.h" |
6 #include "PluginFilter.h" | 6 #include "PluginFilter.h" |
7 #include "PluginSettings.h" | 7 #include "PluginSettings.h" |
8 #include "PluginClass.h" | 8 #include "PluginClass.h" |
9 #include "PluginSystem.h" | 9 #include "PluginSystem.h" |
10 #include <WinInet.h> | 10 #include <WinInet.h> |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 m_contentType = CFilter::EContentType::contentTypeObjectSubrequest; | 325 m_contentType = CFilter::EContentType::contentTypeObjectSubrequest; |
326 } | 326 } |
327 | 327 |
328 if (pszAdditionalHeaders && *pszAdditionalHeaders && IsXmlHttpRequest(*pszAddi
tionalHeaders)) | 328 if (pszAdditionalHeaders && *pszAdditionalHeaders && IsXmlHttpRequest(*pszAddi
tionalHeaders)) |
329 { | 329 { |
330 m_contentType = CFilter::EContentType::contentTypeXmlHttpRequest; | 330 m_contentType = CFilter::EContentType::contentTypeXmlHttpRequest; |
331 } | 331 } |
332 | 332 |
333 if (client->ShouldBlock(szURL, m_contentType, m_boundDomain, /*debug flag but
must be set*/true)) | 333 if (client->ShouldBlock(szURL, m_contentType, m_boundDomain, /*debug flag but
must be set*/true)) |
334 { | 334 { |
| 335 // NOTE: Feeding custom HTML to Flash, instead of original object subrequest |
| 336 // doesn't have much sense. It also can manifest in unwanted result |
| 337 // like video being blocked (See https://issues.adblockplus.org/ticket/1669)
|
| 338 // So we report blocked object subrequests as failed, not just empty HTML. |
335 m_isCustomResponse = m_contentType != CFilter::contentTypeObjectSubrequest; | 339 m_isCustomResponse = m_contentType != CFilter::contentTypeObjectSubrequest; |
336 return E_ABORT; | 340 return E_ABORT; |
337 } | 341 } |
338 return nativeHr; | 342 return nativeHr; |
339 } | 343 } |
340 | 344 |
341 STDMETHODIMP WBPassthruSink::OnResponse(DWORD dwResponseCode, LPCWSTR szResponse
Headers, LPCWSTR szRequestHeaders, LPWSTR *pszAdditionalRequestHeaders) | 345 STDMETHODIMP WBPassthruSink::OnResponse(DWORD dwResponseCode, LPCWSTR szResponse
Headers, LPCWSTR szRequestHeaders, LPWSTR *pszAdditionalRequestHeaders) |
342 { | 346 { |
343 if (pszAdditionalRequestHeaders) | 347 if (pszAdditionalRequestHeaders) |
344 { | 348 { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 } | 388 } |
385 | 389 |
386 return OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved, m_spInterne
tProtocol); | 390 return OnStart(szUrl, pOIProtSink, pOIBindInfo, grfPI, dwReserved, m_spInterne
tProtocol); |
387 } | 391 } |
388 | 392 |
389 STDMETHODIMP WBPassthru::Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [o
ut] */ ULONG *pcbRead) | 393 STDMETHODIMP WBPassthru::Read(/* [in, out] */ void *pv,/* [in] */ ULONG cb,/* [o
ut] */ ULONG *pcbRead) |
390 { | 394 { |
391 WBPassthruSink* pSink = GetSink(); | 395 WBPassthruSink* pSink = GetSink(); |
392 return pSink->OnRead(pv, cb, pcbRead); | 396 return pSink->OnRead(pv, cb, pcbRead); |
393 } | 397 } |
LEFT | RIGHT |