LibWeb: Implement the "check if unloading is canceled" AO

This method is responsible for firing `beforeunload` events.
This commit is contained in:
Tim Ledbetter 2024-10-02 23:56:26 +01:00 committed by Andreas Kling
commit 1fa948f114
Notes: github-actions[bot] 2024-10-05 07:18:28 +00:00
7 changed files with 231 additions and 8 deletions

View file

@ -725,6 +725,12 @@ public:
Unicode::Segmenter& grapheme_segmenter() const;
Unicode::Segmenter& word_segmenter() const;
struct StepsToFireBeforeunloadResult {
bool unload_prompt_shown { false };
bool unload_prompt_canceled { false };
};
StepsToFireBeforeunloadResult steps_to_fire_beforeunload(bool unload_prompt_shown);
protected:
virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;