{"json_modified": "2016-04-29T07:24:13.777506", "uuid": "4dacd929-41fa-4fd8-9f1c-741ba24ca4f6", "title": "Using JavaScript code modules", "url": "/en-US/docs/Mozilla/JavaScript_code_modules/Using", "tags": ["Guide", "XPCOM", "Extensions", "Add-ons", "add-ons", "JavaScript"], "translations": [{"uuid": "f497ab01-210e-460c-9bc4-8e9a11ea0ee1", "title": "Fent servir m\u00f2duls de codi Javascript", "url": "/ca/docs/Fent_servir_m%C3%B2duls_de_codi_Javascript", "tags": [], "summary": "", "localization_tags": [], "locale": "ca", "last_edit": "2014-05-25T12:05:03", "review_tags": []}, {"uuid": "d3cad188-b31f-4da3-b9df-19e27fd596da", "title": "Usando m\u00f3dulos de c\u00f3digo JavaScript", "url": "/es/docs/JavaScript_code_modules/Using", "tags": ["p\u00e1ginas_a_traducir"], "summary": "Los m\u00f3dulos de c\u00f3digo JavaScript son un concepto introducido en Firefox 3 (Gecko 1.9) y pueden ser usados para compartir c\u00f3digo entre alcances (scopes) con diferentes privilegios. Los m\u00f3dulos pueden tambi\u00e9n ser usados para crear singletons globales de JavaScript que previamente requerian usar objetos XPCOM de JavaScript. Un m\u00f3dulo de c\u00f3digo JavaScript es simplemente una porci\u00f3n de c\u00f3digo JavaScript ubicado en una ubiaci\u00f3n registrada. El m\u00f3dulo es cargado dentro de un alcance (scope) de JavaScript espec\u00edfico, tal como un script de XUL o un script XPCOM de JavaScript, usando Components.utils.import.", "localization_tags": [], "locale": "es", "last_edit": "2015-02-11T11:37:15", "review_tags": []}, {"uuid": "d468c6f7-9a6a-4fc4-9c5d-57709879ce9f", "title": "Utilisation de modules de code JavaScript", "url": "/fr/docs/Utilisation_de_modules_de_code_JavaScript", "tags": [], "summary": "Les modules de code JavaScript sont un concept introduit dans Firefox 3 (Gecko 1.9) et peuvent \u00eatre utilis\u00e9s pour partager du code entre diff\u00e9rentes visibilit\u00e9s privil\u00e9gi\u00e9es. On peut \u00e9galement utiliser des modules pour cr\u00e9er des singletons JavaScript globaux pour lesquels on avait auparavant besoin d'objets XPCOM JavaScript. Un module de code JavaScript est simplement constitu\u00e9 de code JavaScript plac\u00e9 \u00e0 un endroit enregistr\u00e9. Celui-ci est charg\u00e9 dans une visibilit\u00e9 JavaScript particuli\u00e8re, comme un script XUL ou un script XPCOM JavaScript, \u00e0 l'aide de Components.utils.import.", "localization_tags": [], "locale": "fr", "last_edit": "2009-05-27T16:16:51", "review_tags": []}, {"uuid": "573fcf31-cb80-437e-9898-968cba5af750", "title": "JavaScript \u30b3\u30fc\u30c9\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5229\u7528", "url": "/ja/docs/Mozilla/JavaScript_code_modules/Using", "tags": ["Extensions", "Add-ons", "add-ons", "XPCOM"], "summary": "JavaScript \u30b3\u30fc\u30c9\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001Gecko\u00a01.9 \u3067\u5c0e\u5165\u3055\u308c\u305f\u30b3\u30f3\u30bb\u30d7\u30c8\u3067\u3042\u308a\u3001\u7279\u6a29\u3092\u6301\u3063\u305f\u7570\u306a\u308b\u30b9\u30b3\u30fc\u30d7\u9593\u3067\u30b3\u30fc\u30c9\u3092\u5171\u6709\u3059\u308b\u305f\u3081\u306b\u7528\u3044\u3089\u308c\u307e\u3059\u3002\u307e\u305f\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001\u30b0\u30ed\u30fc\u30d0\u30eb\u306a JavaScript \u306e\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3059\u308b\u305f\u3081\u306b\u7528\u3044\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059 (\u4ee5\u524d\u306f JavaScript XPCOM \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f)\u3002 JavaScript \u30b3\u30fc\u30c9\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3001\u767b\u9332\u3055\u308c\u305f\u30d1\u30b9\u306b\u914d\u7f6e\u3055\u308c\u305f\u7d14\u7c8b\u306a JavaScript \u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002Components.utils.import()
\u3084 Components.utils[\"import\"]()
\u3092\u4f7f\u3063\u3066\u3001 XUL \u30b9\u30af\u30ea\u30d7\u30c8\u3084 JavaScript XPCOM \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u3088\u3046\u306a\u7279\u5b9a\u306e JavaScript \u306e\u30b9\u30b3\u30fc\u30d7\u3078\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002", "localization_tags": ["inprogress"], "locale": "ja", "last_edit": "2016-04-29T07:24:10", "review_tags": []}, {"uuid": "87864866-e285-4fa7-8972-8f65693baaf0", "title": "Zastosowanie modu\u0142\u00f3w JavaScript", "url": "/pl/docs/Mozilla/JavaScript_code_modules/Zastosowanie_modu%C5%82%C3%B3w_JavaScript", "tags": [], "summary": "", "localization_tags": [], "locale": "pl", "last_edit": "2014-05-29T14:46:53", "review_tags": []}, {"uuid": "4b3fa86b-9b12-427c-b5e4-bdba9d98254f", "title": "\u4f7f\u7528 JavaScript \u4ee3\u7801 modules \u6a21\u5f0f", "url": "/zh-CN/docs/Mozilla/JavaScript_code_modules/Using", "tags": ["Extensions", "Guide", "Add-ons", "XPCOM", "JavaScript"], "summary": "JavaScript code modules \u5728Gecko1.9\u4e2d\u5f15\u5165\u5e76\u88ab\u7528\u4e8e\u5177\u5907\u4e0d\u540c\u6743\u9650\u7684\u4f5c\u7528\u57df\u4e4b\u95f4\u7684\u4ee3\u7801\u5171\u4eab\u3002 Modules \u4e5f\u53ef\u4ee5\u7528\u4e8e\u521b\u5efa\u5168\u5c40js\u5355\u4f8b\uff0c\u8fd9\u5728\u4e4b\u524d\u662f\u901a\u8fc7\u4f7f\u7528XPCOM\uff08\u8de8\u5e73\u53f0\u7ec4\u4ef6\u6a21\u578b\uff09\u5b9e\u73b0\u7684\u3002\u4e00\u4e2a JavaScript code module \u662f\u4ec5\u4ec5\u662f\u4f4d\u4e8e\u6ce8\u518c\u4f4d\u7f6e\u7684\u4e00\u4e9b JavaScript \u4ee3\u7801\u3002Module \u88ab\u8f7d\u5165\u7279\u5b9a\u7684js\u57df\uff0c\u6bd4\u5982 XUL script or JavaScript XPCOM script, \u901a\u8fc7Components.utils.import()
or Components.utils[\"import\"]()
.", "localization_tags": [], "locale": "zh-CN", "last_edit": "2015-02-14T18:49:55", "review_tags": []}], "modified": "2015-12-23T10:14:41", "label": "Using JavaScript code modules", "localization_tags": [], "locale": "en-US", "id": 1918, "last_edit": "2015-12-23T10:14:38", "summary": "JavaScript code modules are a concept introduced in Gecko\u00a01.9 and can be used for sharing code between different privileged scopes. Modules can also be used to create global JavaScript singletons that previously required using JavaScript XPCOM objects. A JavaScript code module is simply some JavaScript code located in a registered location. The module is loaded into a specific JavaScript scope, such as XUL script or JavaScript XPCOM script, using Components.utils.import()
or Components.utils[\"import\"]()
.", "sections": [{"id": "Creating_a_JavaScript_code_module", "title": "Creating a JavaScript code module"}, {"id": "The_URL_for_a_code_module", "title": "The URL for a code module"}, {"id": "Sharing_objects_using_code_modules", "title": "Sharing objects using code modules"}, {"id": "Unloading_code_modules", "title": "Unloading code modules"}, {"id": "Examples", "title": "Examples"}, {"id": "Extending_resource_URLs", "title": "Extending resource: URLs"}, {"id": "Using_chrome.manifest", "title": "Using chrome.manifest"}, {"id": "Programmatically_adding_aliases", "title": "Programmatically adding aliases"}, {"id": "Notes", "title": "Notes"}, {"id": "Custom_modules_and_XPCOM_components", "title": "Custom modules and XPCOM components"}, {"id": "Packaging_notes", "title": "Packaging notes"}, {"id": "Importing_CommonJS_modules", "title": "Importing CommonJS modules"}, {"id": "See_also", "title": "See also"}], "slug": "Mozilla/JavaScript_code_modules/Using", "review_tags": []}