Introduction to CrossOver Plugin: Load a Win32 plugin with native Linux Browser

102 views
Skip to first unread message

Qian Hong

unread,
Nov 23, 2011, 10:14:31 AM11/23/11
to non-ie-online-banking
As we know, CrossOver Plugin provides a bridge between Win32 NPAPI
plugin and native Linux Browser, np-activex is an NPAPI plugin, but
it's quite complex, so let's getting start with a simplest NPAPI
plugin first.

This article contains the following content:
* Install CrossOver Plugin ( Abbr as cxnsplugin )
* Create a bridge for a Win32 NPAPI plugin using cxnsplugin
* Load the Win32 NPAPI plugin with native Linux Browser

1. Install CrossOver Plugin

* Download Nightly Build of CrossOver Pro
* Since this group may be open for everyone in the future, I'm
sorry I couldn't share a public download link for the commercial
software CrossOver Pro. Anybody who wants to try CrossOver can
register an account on http://www.codeweavers.com/ and let me know
your account name, I'll forward to Jemery White and he will set
download permission for you. After that we can download CrossOver
here: http://www.codeweavers.com/compatibility/advocate_center/download/nightly/
* Free tried version can be download here:
http://www.codeweavers.com/products/tosf/ . Also an account is needed.
Free register.

* Assume the downloaded file is called
install-crossover-pro-20111119-unstripped.bin, to install it, we just
need two steps:
$ chmod a+x install-crossover-pro-20111119-unstripped.bin
$ ./install-crossover-pro-20111119-unstripped.bin
Choose a directory to install. I use $HOME/cxoffice-20111119/ for
myself. Choose anywhere you like.

2. Create the bridge

* Firstly we should have a Win32 npapi plugin. A basic plugin can be
download here[1]:
$ wget http://online-banking-with-wine.googlecode.com/files/npbasicplugin.dll
* This plugin works on Windows with several versions of Chrome and Firefox.
* This plugin also works with Wine+Chrome and Wine+Firefox, but it
is not our present concern. ( To work with Wine+Chrome or
Wine+Firefox, some wine bugs should be work around first)

* Secondly, we should create a "Bottle" for "Wine", This wiki[2]
explains what is a Bottle, also called "wineprefix"
* In CrossOver, there is a GUI tool called "cxsetup" for creating
new bottles
* Change directory to which you install CrossOver, in my case,
it is $HOME/cxoffice-20111119/
$ cd $HOME/cxoffice-20111119/
* execute ./bin/cxsetup
* click on "Add a new bottle"
* name the bottle as "test_npbapsic" or anything you like
* the bottle type is "WinXP" by default, no need to change it
* click on "Create", then just wait
* Here we done a new bottle, check your $HOME directory then
you'll find "test_npbasic" in ".cxoffice" :
$ ls -p $HOME/.cxoffice
cxoffice2.conf desktopdata/ test_npbasic/ tie/ usage.log

* Now we can place our win32 NPAPI plugin to our CrossOver Bottle:
$ cp npbasicplugin.dll ~/.cxoffice/test_npbasic/drive_c/Program\
Files/Netscape/Communicator/Program/Plugins/ -v
"npbasicplugin.dll" ->
"/home/fracting/.cxoffice/test_npbasic/drive_c/Program
Files/Netscape/Communicator/Program/Plugins/npbasicplugin.dll"

#Yes, very long path...

* Finally, the most important thing, is to create the bridge.
* execute cxsetup:
$ $HOME/cxoffice-20111119/bin/cxsetup ( or any other where you
install CrossOver)
* Select the Bottle we just create, in our case it is "test_npbasic"
* Click on "Control Panel"
* Click on "Plugin Editor"
* Click on "Recreate"
* Wait for recreating, then select "npbasicplugin.dll | Basic
Example Plugin for Mozilla"
* Click on "OK"
* Check your $HOME/.mozilla/plugins/ for the currently create bridge:
$ ls ~/.mozilla/plugins/
npcxoffice-996ea5c5-6e95-4a0b-a299-ec55e9abf520.linux.npbasicplugin.8612.so

3. Now we have the bridge, so let's test it:
* Open Linux Chrome or Linux Firefox or any other NPAPI compatible Browser
* Check out "about:plugin" or something similar, you'll see such line:
Basic Example Plugin for Mozilla (CrossOver - npbasicplugin.dll)
* Write a sample test html file as below:
--- snip ---
<html>
<object type="application/basic-plugin" width="1000px" height="40px"> </object>
<html/>
--- snip ---
You can also simply download it from [3]

* Open this test html with your Linux Browser. WELL DONE!
* You'll see the Win32 NPAPI plugin is loaded to the native Linux Browser
* In my case, I see "Mozilla/5.0 (X11; Linux i686; rv:7.0.1)
Gecko/20100101 Firefox/7.0.1" in the plugin. Your result may different
with mine.

Notes:
* environment value CX_LOG is useful for debug:
$ CX_LOG=~/test_npbasic_plugin.log firefox test_npbasic_plugin.html
A sample of the log can be downloaded from [4], it is useful for us
to know how CrossOver Plugin works.

* All steps above also can be done in command line, in this case,
cxinstaller and cxnsplugin are useful. The --help option give us more
details about them.
$ ~/cxoffice-20111119/bin/cxnsplugin --help
$ ~/cxoffice-20111119/bin/cxinstaller --help

If you have any problem while trying CrossOver Plugin, feel free to mail me.

Good Luck!

Reference:

[1]http://online-banking-with-wine.googlecode.com/files/npbasicplugin.dll
[2]http://wiki.jswindle.com/index.php/WINEPREFIX
[3]http://online-banking-with-wine.googlecode.com/files/test_basic_plugin.html
[4]http://online-banking-with-wine.googlecode.com/files/test_basic_plugin.log

--
Regards,
Qian Hong

-
Sent from Ubuntu
http://www.ubuntu.com/

Reply all
Reply to author
Forward
0 new messages