Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Plugins

Плагин - это разделяемая библиотека, которую пользователи могут установить для показа содержимого, которое приложение само по себе отображать не может. Например, плагин Adobe Reader позволяет пользователю просматривать файлы PDF прямо внутри браузера, а плагины QuickTime и RealPlayer используются для проигрывания специальных видеоформатов на веб-странице.

Плагины могут быть полезны при создании приложений с использованием фреймворка Mozilla. Например, ActiveState Komodo использует плагины для внедрения редактора Scintilla в пользовательский интерфейс, основанный на XUL.

Плагины пишут при помощи NPAPI, кроссбраузерного API для плагинов. Основной источник документации по NPAPI - Gecko Plugin API Reference. Чтобы получить доступ к функциям плагина из веб-страницы, используйте npruntime. Старые, основанные на XPCOM и LiveConnect API для плагинов использовать не стоит. Эти технологии сами по себе по-прежнему используются, только не для плагинов.

Плагины можно написать полностью с нуля, используя C API (обычно на C или C++), или они могут быть посторены на фреймворке, таком как Firebreath, JUCE, или QtBrowserPlugin. Также есть средства кодогенерации, которые могут быть полезны. Больше информации о них можно найти на странице External Resources.

Вы можете использовать SVG или Canvas для более простых задач управления графикой и анимацией из скрипта.

Плагины отличаются от расширений, которые изменяют или улучшают функциональность браузера. Плагины также отличны от поисковых расширений, которые добавляют поисковые движки в строку поиска.

Документация

Gecko Plugin API Reference (NPAPI)
This reference describes the application programming interfaces for NPAPI plugins and provides information about how to use these interfaces.
Scripting plugins (npruntime)
This reference describes the new cross-browser NPAPI extensions that let plugins be scriptable and also let them access the script objects in the browser.
Gecko SDK
The Gecko SDK contains all of the tools and headers needed for making scriptable plugins for Gecko, including latest npapi.h and associated headers and tools.
Out of process plugins
Firefox 3.6.4 introduced out-of-process plugins which execute in a separate process so that a crashing plugin does not crash the browser.
Shipping a plugin as a Toolkit bundle
Plugins can be shipped as a Toolkit bundle, allowing a user to easily install, uninstall and manage their personal plugins.
Detecting Plugins
How to use JavaScript to detect if a plugin is installed and suggestions on what to do if it is not.
Supporting private browsing in plugins
Firefox 3.5 introduced support for private browsing; learn how to make your plugin respect the user's privacy wishes.
Multi-Process Plugin Architecture
How Firefox loads plugins into a separate process
Logging and Debugging for Multi-Process Plugins
How to create a plugin log to aid in debugging problems with multi-process plugins.
Writing a plugin for Mac OS X
Learn how to write a plugin for Mac OS X; a template Xcode project is provided.
Monitoring Plugins
Use an observer service notification to monitor the amount of time spent executing calls in plugins. This can be useful when trying to determine if a plug-in is consuming too many resources.
Scripting Plugins: Macromedia Flash
This article explains how JavaScript can be used to access methods from within the Flash plugin, as well as how a feature called FSCommands can be used to access JavaScript functions from within the Flash animation.
Plugins: The First Install Problem
The First Install Problem is the name given to the conditions arising when a plugin or embeddable software installs itself on a system first, before any other Gecko-based browser.
ActiveX Control for Hosting Netscape Plug-ins in IE
Microsoft has removed support for Netscape plug-ins from IE 5.5 SP2 and beyond. If you are a plugin author, you may find this project saves you a lot of work!
Plugins: Samples and Test Cases
NPAPI plugin samples and test cases.
External Resources for Plugin Creation
External projects, frameworks, and blog posts that may be useful.
XEmbed Extension for Mozilla Plugins
Recent versions of Mozilla on *nix-based systems include an extension for writing plugins that use XEmbed instead of using the old Xt-based main loop that most plugins have been using since the Netscape 3.x days.

View All...

Сообщество

  • View Mozilla forums...

Extensions, SVG, Canvas

Categories

Interwiki Language Links

 

Метки документа и участники

 Внесли вклад в эту страницу: Cyborg
 Обновлялась последний раз: Cyborg,