Skip to content

Instantly share code, notes, and snippets.

View theIDinside's full-sized avatar

Simon Farre theIDinside

View GitHub Profile
@theIDinside
theIDinside / beforeunload-added-after-history-traversal.html
Last active October 17, 2026 15:58
beforeunload setter after history operation test
<!DOCTYPE HTML>
<meta name="timeout" content="long">
<title>beforeunload listeners added in the same task as a history traversal fire</title>
<link rel="help" href="https://html.spec.whatwg.org/#checking-if-unloading-is-canceled">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="/common/dispatcher/dispatcher.js"></script>
<script src="/html/browsers/browsing-the-web/back-forward-cache/resources/helper.sub.js"></script>
<script>
import gdb
open_files = {}
class PrintArgsBreakpoint(gdb.Breakpoint):
def __init__(self, fn_name, filename):
super(PrintArgsBreakpoint, self).__init__(fn_name)
self.filename = filename
self.fn_name = fn_name
self.file_opened = False