summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/idl/mozIJSSubScriptLoader.idl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /js/xpconnect/idl/mozIJSSubScriptLoader.idl
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--js/xpconnect/idl/mozIJSSubScriptLoader.idl55
1 files changed, 55 insertions, 0 deletions
diff --git a/js/xpconnect/idl/mozIJSSubScriptLoader.idl b/js/xpconnect/idl/mozIJSSubScriptLoader.idl
new file mode 100644
index 0000000000..aad85e5cd3
--- /dev/null
+++ b/js/xpconnect/idl/mozIJSSubScriptLoader.idl
@@ -0,0 +1,55 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "nsISupports.idl"
+
+interface nsIURI;
+interface nsIPrincipal;
+interface nsIObserver;
+
+/**
+ * Interface for synchronous script loads from local file: or jar: sources.
+ * For asynchronous script loads, ChromeUtils.compileScript() should be used
+ * instead.
+ */
+[scriptable, builtinclass, uuid(19533e7b-f321-4ef1-bc59-6e812dc2a733)]
+interface mozIJSSubScriptLoader : nsISupports
+{
+ /**
+ * This method should only be called from JS!
+ * In JS, the signature looks like:
+ * rv loadSubScript (url [, obj] [, charset]);
+ * @param url the url of the UTF-8-encoded sub-script, it MUST be either a
+ * file:, resource:, blob:, or chrome: url, and MUST be local.
+ * @param obj an optional object to evaluate the script onto, it
+ * defaults to the global object of the caller.
+ * @retval rv the value returned by the sub-script
+ */
+ [implicit_jscontext]
+ jsval loadSubScript(in AString url, [optional] in jsval obj);
+
+ /**
+ * This method should only be called from JS!
+ * In JS, the signature looks like:
+ * rv = loadSubScript (url, optionsObject)
+ * @param url the url of the UTF-8-encoded sub-script, which MUST be either
+ * a file:, resource:, blob:, or chrome: url, and MUST be local.
+ * @param optionsObject an object with parameters. Valid parameters are:
+ * - target: an object to evaluate onto (default: global object of the caller)
+ * - ignoreCache: if set to true, will bypass the cache for reading the file.
+ * - async: if set to true, the script will be loaded
+ * asynchronously, and a Promise is returned which
+ * resolves to its result when execution is complete.
+ * - wantReturnValue: If true, the script will return
+ * the value of the last statement that it evaluated.
+ * This option disables most optimizations in the
+ * top-level scope, and should be avoided if at all
+ * possible. Defaults to false.
+ * @retval rv the value returned by the sub-script
+ */
+ [implicit_jscontext]
+ jsval loadSubScriptWithOptions(in AString url, in jsval options);
+};