From 2d4b345bb1a54ecf34d3c088e3a45d61d23a9e57 Mon Sep 17 00:00:00 2001 From: davidot Date: Wed, 19 Jan 2022 10:49:51 +0100 Subject: [PATCH] Spreadsheet: Enable dynamic import of javascript modules This has some risks as it can (attempt to) load arbitrary files on the filesystem but for now it can only load local files which do go through normal file operations. But let's enable it for now to see what we can do with it. --- Userland/Applications/Spreadsheet/Workbook.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Applications/Spreadsheet/Workbook.cpp b/Userland/Applications/Spreadsheet/Workbook.cpp index cf27699373..d67394e040 100644 --- a/Userland/Applications/Spreadsheet/Workbook.cpp +++ b/Userland/Applications/Spreadsheet/Workbook.cpp @@ -40,6 +40,8 @@ Workbook::Workbook(NonnullRefPtrVector&& sheets, GUI::Window& parent_wind m_main_execution_context.realm = &m_interpreter->realm(); m_main_execution_context.is_strict_mode = true; MUST(m_vm->push_execution_context(m_main_execution_context, m_interpreter->global_object())); + + m_vm->enable_default_host_import_module_dynamically_hook(); } bool Workbook::set_filename(const String& filename)