http://wiki.webos-internals.org/index.php?title=Browser_Plugins&feed=atom&action=historyBrowser Plugins - Revision history2024-03-28T18:26:32ZRevision history for this page on the wikiMediaWiki 1.35.1http://wiki.webos-internals.org/index.php?title=Browser_Plugins&diff=3673&oldid=prevHopspitfire at 08:55, 3 August 20092009-08-03T08:55:16Z<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 08:55, 3 August 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{template:patch}}</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>===Call for hackers===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>===Call for hackers===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>Hopspitfirehttp://wiki.webos-internals.org/index.php?title=Browser_Plugins&diff=990&oldid=prevHopspitfire: New page: ===Call for hackers=== From destinal July 11 09 -- This is very much a work in progress. If you are interested in being part of the effort to get a graphical terminal (and any number of...2009-07-20T18:55:13Z<p>New page: ===Call for hackers=== From destinal July 11 09 -- This is very much a work in progress. If you are interested in being part of the effort to get a graphical terminal (and any number of...</p>
<p><b>New page</b></p><div>===Call for hackers===<br />
<br />
From destinal July 11 09 -- This is very much a work in progress. If you are interested in being part of the effort to get a graphical terminal (and any number of other GUI applications) working on the Pre, please contact me at destinal on #webos-internals or email me at predestinal@gmail.com. --destinal<br />
<br />
===Plugin architecture===<br />
<br />
Browser plugins are located a directory defined in the PluginsPath directive in /etc/palm/browser.conf. The default path is shown below.<br />
<br />
<pre><nowiki><br />
browser.conf: PluginsEnabled=true<br />
browser.conf: PluginsPath=/usr/lib/BrowserPlugins<br />
</nowiki></pre><br />
<br />
Browser plugins are ELF-format shared libraries with the standard .so extension. <br />
<br />
To be more specific, in fact, webOS browser plugins use the NPAPI specification common in WebKit and Gecko-based browsers. <br />
<br />
For information on how to create an NPAPI compliant plugin, see [https://developer.mozilla.org/en/Plugins Mozilla Plugin Documentation]<br />
<br />
===Stock plugins===<br />
<br />
<pre><nowiki><br />
root@castle:/usr/lib/BrowserPlugins# ls *.so<br />
BrowserAdapter.so MAPartsAdapter.so PDFAdapter.so<br />
LunaMediaAdapter.so OfficeAdapter.so TnAdapter.so<br />
</nowiki></pre><br />
<br />
<br />
Upon Luna start, all shared libraries in the plugins directory are loaded and registered based on the MIME type they return in their public function NP_GetMIMEDescription()<br />
<br />
===Stock plugins by MIME type===<br />
<br />
<pre><nowiki><br />
root@castle:/# grep x- /usr/lib/BrowserPlugins/*<br />
/usr/lib/BrowserPlugins/BrowserAdapter.so:application/x-palm-browser<br />
/usr/lib/BrowserPlugins/LunaMediaAdapter.so:application/x-palm-media;media;Media File<br />
/usr/lib/BrowserPlugins/MAPartsAdapter.so:application/x-motionapps-partsadapter<br />
/usr/lib/BrowserPlugins/OfficeAdapter.so:application/x-palm-officeadapter<br />
/usr/lib/BrowserPlugins/PDFAdapter.so:application/x-palm-pdfadapter<br />
/usr/lib/BrowserPlugins/TnAdapter.so:application/x-navigation<br />
</nowiki></pre><br />
<br />
<br />
===Building a working browser plugin (using the basicplugin sample)===<br />
<br />
==Getting the code==<br />
<br />
BasicPlugin is located in the [http://gitorious.org/webos-internals/applications webos-internals applications repository]. A sample webOS / mojo application called helloplugin which embeds it is also available there.<br />
<br />
<pre><nowiki><br />
git clone git://gitorious.org/webos-internals/applications.git<br />
<br />
</nowiki></pre><br />
<br />
== Ensure you have required libraries==<br />
<br />
This depends on your linux distro. On ubuntu, you will need build-essential, libglib2.0-dev, and libx11-dev:<br />
<br />
<pre><nowiki><br />
sudo apt-get install build-essential libglib2.0-dev libx11-dev<br />
</nowiki></pre><br />
<br />
== Building the plugin (basicplugin.so)==<br />
<br />
<pre><nowiki><br />
cd applications/basicplugin<br />
make<br />
</nowiki></pre><br />
<br />
=== Installing the plugin===<br />
<br />
Copy basicplugin.so to your pre or emulator into the directory /usr/lib/BrowserPlugins.<br />
<br />
That's it!<br />
<br />
=== Installing the mojo app to call it===<br />
<br />
Copy the directory applications/org.webosinternals.helloplugin to your applications directory on your pre or emulator (/var/usr/palm/applications)<br />
<br />
Rescan Luna packages or reboot to get an icon to launch it.<br />
<br />
=== Running the plugin===<br />
<br />
Simply click the "Hello Plugin" link in the emulator.<br />
<br />
If everything worked, you'll have a blue card. <br />
<br />
=== A blue card?===<br />
<br />
Later versions of the sample plugin will do something more exciting, but that's not the point.<br />
<br />
More importantly, check out the code, and use it as a template to create your own browser plugins.<br />
<br />
Also check out the mojo code for more advanced plugin-based-apps to see the huge amounts of event forwarding code required for a proper app<br />
<br />
<br />
=== Things to try next===<br />
<br />
Write useful plugins<br />
<br />
Enhance mojo app to transmit keyboard, pen, and other events.<br />
<br />
=== Plugins vs extensions===<br />
<br />
Some have suggested using this technique to run Mozilla extensions such as ChatZilla. Note that NPAPI is for plugins rather than extensions -- plugins are native shared libraries of binary code providing functions that are called directly by the browser, whereas extensions are interpreted XML, JavaScript, and similar technologies. Though the Gecko SDK recommended to obtain the plugin libraries is the XULRunner SDK, we are only using the NPAPI / plugin headers, executing XUL / extensions is a long way off. <br />
<br />
More on plugins seems to be at:<br />
* http://www.mozilla.org/projects/plugins/<br />
* https://developer.mozilla.org/en/Plugins<br />
* http://plugindoc.mozdev.org<br />
* https://addons.mozilla.org/en-US/firefox/browse/type:7<br />
* http://colonelpanic.net/2009/03/building-a-firefox-plugin-part-one/<br />
* http://colonelpanic.net/2009/05/building-a-firefox-plugin-part-two/<br />
<br />
'''About'''<br />
This stuff so far: destinal<br />
thanks to:<br />
* bpadalino (help in debugging)<br />
* mdklein (npapi, npsimple ideas)</div>Hopspitfire