[quickjs-devel] Intercept/disable import functionality?

  • From: Alastair Coote <alastair.coote@xxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Wed, 21 Aug 2019 13:48:12 -0400

From my understanding, QuickJS includes the ability to load modules via
import calls. I'm interested in using QuickJS to create a sandboxed JS
environment, so the idea of it being able to import files from arbitrary
paths is not a good fit.

Is there/could there be a way to intercept import calls and return whatever
we want? Or, failing that, can I disable the import functionality entirely?

Thanks!

Other related posts: