Skip to content
This repository was archived by the owner on Jan 4, 2024. It is now read-only.

Commit 36daaf3

Browse files
committed
Improve IE refresh detection.
1 parent 1bc934e commit 36daaf3

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

ie/build/Win32/Release/bho32.dll

0 Bytes
Binary file not shown.

ie/build/x64/Release/bho64.dll

0 Bytes
Binary file not shown.

ie/source/bho/BrowserHelperObject.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ CBrowserHelperObject::CBrowserHelperObject()
6161
m_isAttached(false),
6262
m_nativeAccessible(),
6363
m_frameProxy(NULL),
64-
m_nPageCounter(0),
64+
m_isPageNavigation(false),
6565
m_nObjCounter(0),
6666
m_bIsRefresh(false)
6767
{
@@ -435,7 +435,7 @@ void __stdcall CBrowserHelperObject::OnDocumentComplete(IDispatch *dispatch,
435435
VARIANT *url)
436436
{
437437

438-
--m_nPageCounter;
438+
m_isPageNavigation = false;
439439

440440
Manifest::pointer manifest = _AtlModule.moduleManifest;
441441

@@ -733,8 +733,8 @@ void __stdcall CBrowserHelperObject::OnWindowStateChanged(DWORD flags, DWORD mas
733733
*/
734734
void __stdcall CBrowserHelperObject::OnBeforeNavigate2(IDispatch *idispatch, VARIANT *url, VARIANT *Flags, VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers, VARIANT_BOOL* Cancel)
735735
{
736-
// add page counter so we can compare in DownloadBegin function
737-
++m_nPageCounter;
736+
// add page flag so we can compare in DownloadBegin function
737+
m_isPageNavigation = true;
738738

739739
LPDISPATCH lpWBDisp = nullptr;
740740
HRESULT hr = S_OK;
@@ -761,7 +761,7 @@ void __stdcall CBrowserHelperObject::OnBeforeNavigate2(IDispatch *idispatch, VAR
761761
*/
762762
void __stdcall CBrowserHelperObject::OnDownloadBegin()
763763
{
764-
if (m_nPageCounter == 0)
764+
if (!m_isPageNavigation)
765765
m_bIsRefresh = true;
766766

767767
++m_nObjCounter;

ie/source/bho/BrowserHelperObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ END_SINK_MAP()
101101
bool m_isConnected;
102102
bool m_isAttached;
103103

104-
int m_nPageCounter;
104+
bool m_isPageNavigation;
105105
int m_nObjCounter;
106106
bool m_bIsRefresh;
107107
wstring m_strUrl;

0 commit comments

Comments
 (0)