Skip to content

Commit 2f96ee9

Browse files
committed
WinForms/WPF/OffScreen - Disable back forward cache to improve javascript integration reliability
- Workaround for common cause of "Error while fulfilling of JS: Request BrowserId : 1 not found it's likely the browser is already closed" Issue #4621
1 parent 7a23473 commit 2f96ee9

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

CefSharp.OffScreen/CefSettings.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public CefSettings() : base()
2929
// Disable "Restore pages" popup after incorrect shutdown
3030
// https://github.com/chromiumembedded/cef/issues/3767
3131
CefCommandLineArgs.Add("hide-crash-restore-bubble");
32+
33+
// Disable the back-forward cache
34+
// https://github.com/cefsharp/CefSharp/issues/4621
35+
CefCommandLineArgs.Add("disable-back-forward-cache");
3236
}
3337

3438
/// <summary>

CefSharp.WinForms/CefSettings.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ public CefSettings() : base()
2323
// Disable "Restore pages" popup after incorrect shutdown
2424
// https://github.com/chromiumembedded/cef/issues/3767
2525
CefCommandLineArgs.Add("hide-crash-restore-bubble");
26+
27+
// Disable the back-forward cache
28+
// https://github.com/cefsharp/CefSharp/issues/4621
29+
CefCommandLineArgs.Add("disable-back-forward-cache");
2630
}
2731
}
2832
}

CefSharp.Wpf/CefSettings.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ public CefSettings() : base()
3434
// Browser not correctly refreshing on Resize
3535
// https://github.com/cefsharp/CefSharp/issues/4953
3636
CefCommandLineArgs.Add("disable-gpu-compositing");
37+
38+
// Disable the back-forward cache
39+
// https://github.com/cefsharp/CefSharp/issues/4621
40+
CefCommandLineArgs.Add("disable-back-forward-cache");
3741
}
3842
}
3943
}

CefSharp.Wpf/HwndHost/CefSettings.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ public CefSettings() : base()
2121
// Disable "Restore pages" popup after incorrect shutdown
2222
// https://github.com/chromiumembedded/cef/issues/3767
2323
CefCommandLineArgs.Add("hide-crash-restore-bubble");
24+
25+
// Disable the back-forward cache
26+
// https://github.com/cefsharp/CefSharp/issues/4621
27+
CefCommandLineArgs.Add("disable-back-forward-cache");
2428
}
2529
}
2630
}

0 commit comments

Comments
 (0)