How to deploy a simple NPAPI plugin DLL in Mozilla Firefox (v29.0.1) in Windows? - npapi

I downloaded "npsimple" NPAPI plugin for Mozilla from the link "https://code.google.com/p/npapi-chrome-plugin-helloworld-example/source/browse/trunk/samplevsproject/?r=2"
I was able to build it fine and run the plugin code in Chrome by packing the "npsimple.dll" as Chrome extension (.crx) and run it Chrome browser.
But I wasn't able to deploy the same NPAPI plugin "npsimple.dll" in Mozilla Firefox. I tried keeping the dll in mozilla firefox's installation folder under "plugins" folder, and restarted the browser. It did not help.
Could someone give some pointers on how to go about deploying NPAPI plugin dll in Mozilla Firefox?
I tried the following ways, but it didn't work.
I tried doing it by writing a plugininstall.reg file having following content inside it and imported the file in regedit window. Then I restarted Mozilla Firefox and it didn't work,
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\MozillaPlugins\#somecompany.com/npSample,version=1.‌​0.0.1]
"Description"="A sample plugin"
"Path"="D:\\Projects\\Browser_Plugin_Development\\NPAPI_Samples\\npapi_vs2008\\npsimp‌​le\\Debug\\npsimple.dll"
"ProductName"="npsimple"
"Vendor"="somecompany"
"Version"="1.0.0.1"
Even I've tried keeping the npsimple.dll plugin under Mozilla's plugins directory "C:\Program Files\Mozilla Firefox\plugins" and that too didn't help.
Thanks,
Prem

The page you want is on the mozilla wiki.
Here is what you need to do: (quoted from that page)
Windows Installation Using the Registry
On Windows, plug-ins should be installed to a plug-in-specific directory such as C:\Program Files\Plugin Name\nppluginname.dll. Then the following registry values should be added to the Windows registry (the plug-in-identifier should follow the specification):
HKLM/Software/MozillaPlugins/plugin-identifier
Descripton: REG_SZ "Description of the Plugin"
Path: REG_SZ "C:..Path to the plugin.dll"
ProductName: REG_SZ "The Plugin Name"
Vendor: REG_SZ "The Plugin Author/Vendor"
Version: REG_SZ "0.5.whatever plugin version string"
-
HKLM/Software/MozillaPlugins/plugin-identifier/MimeTypes
Add a sub-key for each MIME type the plugin supports, with no values
It is worth noting that you can also use HKCU, though note that when doing both 32 and 64 bit versions HKCU doesn't support the SysWOW32 virtualization that HKLM does. (If that means nothing to you then you can probably ignore it)

Related

Chrome Headless Doesn't work

I've read about the Chrome Headless from developers.google said we can run the Google without UI. Quote from that link :
Headless Chrome is shipping in Chrome 59. It's a way to run the Chrome
browser in a headless environment. Essentially, running Chrome without
chrome! It brings all modern web platform features provided by
Chromium and the Blink rendering engine to the command line.
Why is that useful?
A headless browser is a great tool for automated testing and server
environments where you don't need a visible UI shell. For example, you
may want to run some tests against a real web page, create a PDF of
it, or just inspect how the browser renders an URL.
This is really great feature, so I do some experiment with this cool feature. The idea is to taking snapshot as the document site by do call of chrome.exe from Windows Command Prompt, as follow :
chrome --headless --disable-gpu --screenshot https://www.chromestatus.com/
After do several times and following the instruction from these site. I got nothing. I don't get any picture or screenshot with name screenshot.png as document mention it before Running with --screenshot will produce a file named screenshot.png in the current working directory.
From this document also said about version,
Caution: Headless mode is available on Mac and Linux in Chrome 59.
Windows support is coming in Chrome 60. To check what version of
Chrome you have, open chrome://version.
after do some check with suggested before, I run chrome://version on my Chrome on Windows x64 Machine and got some result :
Google Chrome 62.0.3202.94 (Official Build) (64-bit) (cohort: Stable)
Revision 4fd852a98d66564c88736c017b0a0b0478e885ad-refs/branch-heads/3202#{#789}
What wrong? What i missed?
Thanks
After do some experiments. for --screenshot will save the image on the same level as chrome.exe location and that will be mean save on Program Files.
So we need need to combine parameter names and arguments with a =
--screenshot="D:\screen.png" will work, otherwise Chrome writes to it's installation folder. Big design flaw, no software should use it's installation folder as a working directory.
Here are the complete argument :
chrome --headless --enable-logging --disable-gpu --screenshot="D:\screen.png" "https://www.chromestatus.com/"

How can I downgrade to Chrome 42.0.2311.90?

Google Chrome on my machine recently got updated to v44.
I'm working with Selenium WebDriver on Chrome and as soon as I updated Chrome, all my tests went dead. I use Chromedriver v2.16. My partner's PC has Chrome v42.0.2311.90 and Chromedriver v2.16. And tests run fine on his machine. Now, based on this I'm pretty sure the problem is probably not with Chromedriver.
So, how can I downgrade to Chrome 42.0.2311.90?
I've tried using an offline installer from here:
Google Chrome Alternate Offline Installer
But this always gives me the latest version to install i.e. v44.
The release that I need can be found here:
Google Chrome v42.0.2311.90 Stable Channel Update
Uninstall your current chrome version.
Remove all Chrome data for current version from: C:\Users\username\AppData\Local\Google\Chrome
Download your particular version from chrome_installer.
Disable chrome updates using instructions given on this link.
Following steps help you to install your desired google chrome version :
1 - Uninstall your current google chrome version.
2 - Download your desired google chrome version from here : Google Chrome Download
3 - Restart PC once so if any registry or temp file stored of previous google chrome then it will get refresh.
4 - Install your downloaded google chrome. And then turn off automatic chrome update.
I struggled with this same problem on Mac, trying to downgrade, and stay downgraded from Chrome 53 to 52 due to a serious bug affecting webaudio.
None of the other recommendation appear to apply any more (or on Mac OS X at least). The app attempts to upgrade itself and there doesn't be a way to configure that in a "Chrome-friendly" way.
Eventually I resorted to force...
Close and uninstall Chrome
Edit your /etc/hosts file to prevent update checks from working by overriding the DNS entry:
0.0.0.0 tools.google.com
Find and download an old release. This is left as an exercise, this was actually hard and fraught with fear of bad binaries. I was able to cross-reference MD5s from one site that didn't have downloads with another that had downloads.
Install and run the older version
Important: Check the "About" page, and point and laugh at Chrome's attempts to check in.
This is how you can use an older chrome version "in general":
Uninstall your current chrome
Install the chrome version you desire
DO NOT open chrome!! after installation
Instead disable auto-updates like here or here
Only then may you work with your desired chrome browser version
As for how to get a specific older version:
You need to google, search forums or try sites like this. It's just "grunt work" to find the version you are looking for. If you're extremely unlucky, the very version you need might even not be around any more.
If you are running on a windows machine you can leverage the package manager chocolatey, this is how we I'm doing it from Jenkins, we call a powershell that uninstalls a previous version and install a specific one: From a powershell ide script window, you need to have installed the modules for chocolatey that is a small price to pay for a lot of benefit:
choco install googlechrome --version 62.0.3202.94 -y
Then to prevent Chrome to self update I am performing this steps:
1. Verify Chrome's current version.
(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe').'(Default)').VersionInfo
Install the version I'm aiming for:
choco install googlechrome --version 62.0.3202.94 -y
You can look for available versions here:
https://chocolatey.org/packages/GoogleChrome
(Find Version History Section)
Kill GoogleCrashHandler.exe in any of its variants 32 or 64 bits or both.
Delete the Directories
C:\Program Files (x86)\Google\Update and
C:\Program Files (x86)\Google\CrashReporter
You will loose the ability to auto update (which is the whole purpose right) and
you will loose the ability to send crash reports and piggy back on that executable to update against your will whenever google deems convenient.
5.Disable Chrome Services

How do I package a NPAPI plugin for chrome in linux?

I have developed a NPAPI plugin with FireBreath. I've read the method on Chrome NPAPI Plugins and Google Chrome Extensions and NPAPI, then followed that way to include my npapi.so file in the manifest.json like this:
"plugins": [
{ "path": "linux_npapi.so" }
]
Actually, I packaged my plugin file into .crx and installed it successfully, but when I run my test page, the plugin didn't seem to work.
I have already tryed to package my plugin into .xpi and it worked fine with firefox. Then I've followed the way on Deploying and updating your plugin and copyed my plugin file into ~/.mozilla/plugins. It worked fine on firefox too, but still failed to work on chrome. :( And my plugin didn't show in chrome://plugins page.
How do I package a NPAPI plugin for chrome in linux?
Chrome version is 32.0.1700.107 .
Any help would be greatly appreciated...
Thanks...
When you build a plugin on linux, you either build it 32 bit or 64 bit. If you build it 32 bit it will load in 32 bit browsers, and 64 bit will load in 64 bit browsers. You need to make sure you build it correctly for what you want.
It sounds like that's your issue -- you are trying to load a 32 bit plugin on a 64 bit process and/or vise versa. That won't work.
Unfortunately I don't know offhand how to make cmake build 32 bit on a 64 bit system.

Should I sign the Chrome Extension or NPAPI plugin?

I am packing a NPAPI plugin into a Chrome extension.
My doubt here should I code-sign the NPAPI plugin or the Chrome extension?
Part of the process of making the package is that the zip file (this is what a crx is) is signed. See http://developer.chrome.com/extensions/crx.html for more details.
This should mean that the download you get from the store can be verified. It does not mean however that once installed that the contents on the disk have not been modified - crx's are unpacked once they are installed and once unpacked the user could manipulate them. So if you are concerned that the NPAPI could be tampered with once installed then you would have to look in to how to do that.

How to Set Path for Chromium Browser in SublimeText2's Slidebar Enhancement Plugin In Ubuntu?

For Running PHP in SublimeText2 I Installed Slidebar Enhancement Plugin & PHPCodeSniff Plugin.
But When I Try to Run By Pressing F12.It Gives Pop-up "Browser 'Chrome' not found.If Installed? Which Location?'
On Right Click of Any/File Folder Open With..Application...I Opened File"Side Bar.sublime-menu"
Here SetupPath For Windows Given. But How to Setup it In Ubuntu?
like, "application": "C:\Documents and Settings\tito\Configuración local\Datos de programa\Google\Chrome\Application\chrome.exe",
But How To Set Path For Chromium in Ubuntu?
To get the path of Chromium on Ubuntu open a terminal window and type:
whereis chromium-browser
Most likely you need the path starting from /usr/bin. In my case: /usr/bin/chromium-browser.