2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
2012-05-21 04:12:37 -07:00
|
|
|
* 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2013-11-05 07:35:41 -08:00
|
|
|
[scriptable, uuid(b21f1579-d994-4e99-a85d-a685140f3ec1)]
|
2007-03-22 10:30:00 -07:00
|
|
|
interface mozIJSSubScriptLoader : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* This method should only be called from JS!
|
|
|
|
* In JS, the signature looks like:
|
2010-10-07 10:44:55 -07:00
|
|
|
* rv loadSubScript (url [, obj] [, charset]);
|
2013-11-05 07:35:41 -08:00
|
|
|
* @param url the url of the sub-script, it MUST be either a file:,
|
2007-03-22 10:30:00 -07:00
|
|
|
* resource:, 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.
|
2010-10-07 10:44:55 -07:00
|
|
|
* @param charset optionally specifies the character encoding of
|
|
|
|
* the file. If absent, the file is interpreted
|
2011-12-18 02:09:16 -08:00
|
|
|
* as ASCII.
|
2007-03-22 10:30:00 -07:00
|
|
|
* @retval rv the value returned by the sub-script
|
|
|
|
*/
|
2011-12-18 02:09:16 -08:00
|
|
|
[implicit_jscontext]
|
|
|
|
jsval loadSubScript(in AString url, [optional] in jsval obj, [optional] in AString charset);
|
2013-11-05 07:35:41 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This method should only be called from JS!
|
|
|
|
* In JS, the signature looks like:
|
|
|
|
* rv = loadSubScript (url, optionsObject)
|
|
|
|
* @param url the url of the sub-script, it MUST be either a file:,
|
|
|
|
* resource:, or chrome: url, and MUST be local.
|
|
|
|
* @param optionsObject an object with parameters. Valid parameters are:
|
|
|
|
* - charset: specifying the character encoding of the file (default: ASCII)
|
|
|
|
* - 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.
|
|
|
|
* @retval rv the value returned by the sub-script
|
|
|
|
*/
|
|
|
|
[implicit_jscontext]
|
|
|
|
jsval loadSubScriptWithOptions(in AString url, in jsval options);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|