npapi replacement which can make native win32 and MFC api calls

540 views
Skip to first unread message

Rajesh Katalkar

unread,
Nov 13, 2013, 8:12:14 AM11/13/13
to chromium-...@chromium.org
I have a extension which uses npapi and i am planning in replacing npapi as its going to phased out.Possible alternatives found are
1)Pepperapi
2)native messaging api

Can someone help me decide which one is good and future proof and allow me to call windows native calls in both desktop browser and metro brower in win8 ,8.1

..Also i have used the pepper sdk and vs2010 sdk ..and the hello_nacl example gaol is to show how to convert from native to nacl...
but nacl uses native client sdk which is gcc ..which will not compile my win32 call if i am not wrong.........

this replacement interface is going to do IPC with desktop app using shared memory api and syncronization api's.


Another question is about deployment .There is news google will only allow extension only from webstore ..we currently use registry based technique for this.
http://www.zdnet.com/google-to-tighten-up-chrome-extension-security-on-windows-7000022950/
Is this true...Is there another alternative than CWS if this is true?




PhistucK

unread,
Nov 13, 2013, 9:31:14 AM11/13/13
to Rajesh Katalkar, Chromium-extensions
1. As far as I know, the Pepper API cannot make native system calls. Native messaging is the only way to make Win32 calls or use MFC (I presume it also makes system calls).
2. This is indeed true, you will have to upload it to the web store, or install via Enterprise policy (if any). Antony enumerates all of the options here - https://groups.google.com/a/chromium.org/d/msg/chromium-extensions/PZaNR7obIdQ/fOCQRQbAG60J


PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/57e6a3ba-0e3f-4740-ad99-bc7524dc7793%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/groups/opt_out.

Rajesh Katalkar

unread,
Nov 14, 2013, 12:38:05 PM11/14/13
to chromium-...@chromium.org, Rajesh Katalkar

Pepper api builds with vc++ compiler .then it should be possible to call win32 and mfc if i am not wrong.Also i have read that in future pepperapi can be called only from a nacl module...
http://www.chromium.org/nativeclient/getting-started/getting-started-background-and-basics

Although traditional NPAPI plugins in Chrome run only out of process, Chrome 5 supports Pepper plugins only in process. Being a somewhat experimental feature, the only way to load trusted Pepper plugins is through the browser command-line options. In the future, Pepper plugins will only be supported within Native Client.


does it mean it cannot be called from html directly.
Also it necessary that it loads in metro mode also .I have heard some devs reporting that it fails to load in metro mode.Is this true.

I know native messaging technique works in metro mode as i have tested its sample app.

Also loading crx manually will be present or not ? and does pepper needs nacl to be enabled from chrome flags to load if extension loaded out of CWS

On Wednesday, 13 November 2013 20:01:14 UTC+5:30, PhistucK wrote:
1. As far as I know, the Pepper API cannot make native system calls. Native messaging is the only way to make Win32 calls or use MFC (I presume it also makes system calls).
2. This is indeed true, you will have to upload it to the web store, or install via Enterprise policy (if any). Antony enumerates all of the options here - https://groups.google.com/a/chromium.org/d/msg/chromium-extensions/PZaNR7obIdQ/fOCQRQbAG60J


PhistucK


On Wed, Nov 13, 2013 at 3:12 PM, Rajesh Katalkar <rajesh...@gmail.com> wrote:
I have a extension which uses npapi and i am planning in replacing npapi as its going to phased out.Possible alternatives found are
1)Pepperapi
2)native messaging api

Can someone help me decide which one is good and future proof and allow me to call windows native calls in both desktop browser and metro brower in win8 ,8.1

..Also i have used the pepper sdk and vs2010 sdk ..and the hello_nacl example gaol is to show how to convert from native to nacl...
but nacl uses native client sdk which is gcc ..which will not compile my win32 call if i am not wrong.........

this replacement interface is going to do IPC with desktop app using shared memory api and syncronization api's.


Another question is about deployment .There is news google will only allow extension only from webstore ..we currently use registry based technique for this.
http://www.zdnet.com/google-to-tighten-up-chrome-extension-security-on-windows-7000022950/
Is this true...Is there another alternative than CWS if this is true?




--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

PhistucK

unread,
Nov 14, 2013, 2:11:39 PM11/14/13
to Rajesh Katalkar, Chromium-extensions
1. I am not sure you can create PPAPI using Visual Studio. See http://stackoverflow.com/questions/19425728/how-to-create-a-ppapi-plugin-for-google-chrome-in-windows, for example.
2. You could load your extension an an unpacked extension, but the browser will (in the near future) show a prominent warning to users (who are basically extension developers) that run unpacked extensions.


PhistucK


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Rajesh Katalkar

unread,
Nov 15, 2013, 3:14:43 AM11/15/13
to PhistucK, Chromium-extensions
new pepper sdk supports vs2010 and provides addin for it.so get integrated with it.
https://developers.google.com/native-client/pepper23/devguide/devcycle/vs-addin

Jeffrey if pepperapi cannot access win32 api i.e native api's whats the use of pepperapi compiling with vs2010 compiler.why even have pepperapi then

PhistucK

unread,
Nov 15, 2013, 4:39:12 AM11/15/13
to Rajesh Katalkar, Chromium-extensions
Some people like Visual Studio better for its debugging, IntelliSense and other features.


PhistucK

Rajesh Katalkar

unread,
Nov 15, 2013, 8:18:03 AM11/15/13
to chromium-...@chromium.org, Rajesh Katalkar
Its not just the IDE ...after using addin there are preconfigured profiles .NACL,PPAPI ....
NACL uses nacl compiler...this is understood.
PPAPI uses vs2010 compiler..This plugin works also.

The question if PPAPI can use vs2010 compiler and can link to win32 and why calling native api's not valid.

If native is restricted then there should be only NACL which uses nacl compiler...

why so many options and behavior like nacl only


PhistucK




PhistucK




PhistucK


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsubscribe...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.

PhistucK

unread,
Nov 15, 2013, 8:27:14 AM11/15/13
to Rajesh Katalkar, Chromium-extensions
I have not found a document that states that PPAPI can be compiled using Visual Studio compilers.


PhistucK


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Rajesh Katalkar

unread,
Nov 15, 2013, 1:54:17 PM11/15/13
to chromium-...@chromium.org, Rajesh Katalkar
use the addin from pepper sdk

https://developers.google.com/native-client/devguide/devcycle/vs-addin

https://developers.google.com/native-client/pepper23/devguide/devcycle/vs-addin#ppai
https://developers.google.com/native-client/devguide/devcycle/vs-addin#ppai

The PPAPI platform

The PPAPI platform builds your module as a dynamic library and launches a version of Chrome that’s configured to run the library as a plugin when it encounters an <embed> element with type=application/x-nacl (ignoring the information in the manifest file). When running in the PPAPI platform, you can use Windows system calls that are unavailable in a regular Native Client module built and running as a .nexe file. This offers the ability to port existing code incrementally, rewriting functions using the PPAPI interfaces one piece at a time. Since the module is built with Visual Studio’s native compiler (MSBuild) you can use the Visual Studio debugger to control and inspect your code.

Then see my second comment of this thread...I don't want to copy it again.


PhistucK




PhistucK




PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

PhistucK

unread,
Nov 15, 2013, 2:39:13 PM11/15/13
to Rajesh Katalkar, Antony Sargent, Chromium-extensions
Sorry, it looks like you are right (I hope the documentation is up to date, though).
Antony, can you, please, advise here?


PhistucK


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Antony Sargent

unread,
Nov 15, 2013, 3:44:34 PM11/15/13
to PhistucK, Rajesh Katalkar, Chromium-extensions
My understanding is that you cannot install your own plugins that talk directly to the PPAPI interface and also run with unrestricted access to the rest of the OS (like NPAPI plugins); rather you must have your code running inside the NaCl/PNaCl sandbox, and cannot make direct Win32/MFC calls. 

If you need to have binary code directly using Win32/MFC, your best bet is to split things up into two pieces - a native binary that does the Win32/MFC stuff, and your extension that uses native messaging to exchange messages with your native binary. The extension should be hosted in the webstore or installed with enterprise policy.

PhistucK

unread,
Nov 15, 2013, 3:47:45 PM11/15/13
to Antony Sargent, Rajesh Katalkar, Chromium-extensions
Can you talk to the relevant people so they would update the documentation Rajesh mentioned? it does seem to imply that this kind (system call making) of PPAPI plugins is legitimate...


PhistucK

Joe Marini

unread,
Nov 15, 2013, 4:01:50 PM11/15/13
to PhistucK, Antony Sargent, Rajesh Katalkar, Chromium-extensions

PhistucK

unread,
Nov 15, 2013, 4:11:57 PM11/15/13
to Joe Marini, Antony Sargent, Rajesh Katalkar, Chromium-extensions
Actually, I am not sure any correction is needed.
This is a section within the Native Client documentation, it is not the PPAPI documentation per se (or maybe it is, but PPAPI is not explained very well anywhere) and Rajesh assumed it is, probably because there is no real (up to date) PPAPI documentation anywhere. It also says it "launches a version of Chrome that’s configured to run the library as a plugin" in order "to port existing code incrementally, rewriting functions using the PPAPI interfaces one piece at a time".


PhistucK

Rajesh Katalkar

unread,
Nov 16, 2013, 12:25:14 PM11/16/13
to chromium-...@chromium.org, Joe Marini, Antony Sargent, Rajesh Katalkar
You are saying its to port .But then flash is pepper plugin or nacl plugin?
I have seen the hello world example where it show 1-6 steps to porting...But that's where its gets confusing...
It says with pepper we can use new pepper interface and make windows systems call which nacl cannot do as mentioned below.
It never mentioned any where that the .dll is not going to work in chrome.and cannot be deployed as it is.

If nacl is what the final thing should be then pepper should not even exist .
this porting thing is actually as good as rewriting whole plugin from scratch if native calls are not supported.Its actually double work...
first you spend time to make pepper and then spend time to remove native call and compile with nacl sdk.
If devs can develop napapi from scratch they can also develop nacl or pepper or whatever you want to say from scratch instead of spending double time.

Plus if you see my second comment of this thread....it says sometime in future pepper will supported in native client(nacl)..what does this mean.Do double work now and again in future do the same double work again.
///////////

Also i have read that in future pepperapi can be called only from a nacl module...
http://www.chromium.org/nativeclient/getting-started/getting-started-background-and-basics

Although traditional NPAPI plugins in Chrome run only out of process, Chrome 5 supports Pepper plugins only in process. Being a somewhat experimental feature, the only way to load trusted Pepper plugins is through the browser command-line options. In the future, Pepper plugins will only be supported within Native Client.


does it mean it cannot be called from html directly?
///////////////////////////

The PPAPI platform

The PPAPI platform builds your module as a dynamic library and launches a version of Chrome that’s configured to run the library as a plugin when it encounters an <embed> element with type=application/x-nacl (ignoring the information in the manifest file). When running in the PPAPI platform, you can use Windows system calls that are unavailable in a regular Native Client module built and running as a .nexe file. This offers the ability to port existing code incrementally, rewriting functions using the PPAPI interfaces one piece at a time. Since the module is built with Visual Studio’s native compiler (MSBuild) you can use the Visual Studio debugger to control and inspect your code

/////////////////////
I know you or others will say use this use that ..But i want to know why ..with what exactly is npapi is replaced with and how it works ,what it supports and does not.its future and it deployment requirement.

I have to understand properly the new interface and develop my plugin again because its not actually just porting if no native call supoort, its a lot of work.But that's to be cleared first.


PhistucK




PhistucK




PhistucK




PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Antony Sargent

unread,
Nov 16, 2013, 5:51:24 PM11/16/13
to Rajesh Katalkar, Chromium-extensions, Joe Marini
Yes, my understanding is that we use PPAPI to interface with Flash, the PDF reader plugin, and NaCl, but aren't letting third-party plugins use it directly. But it's possible I'm not correct. You best bet is probably to check out the resources at:


There is a link there to the discussion list at https://groups.google.com/group/native-client-discuss - that would be the best place to get all your PPAPI / NaCl questions definitively answered. 


Rajesh Katalkar

unread,
Nov 17, 2013, 3:08:09 AM11/17/13
to chromium-...@chromium.org, Rajesh Katalkar, Joe Marini
Depending on what you said ,It means that google allow their friendly business partners Adobe  to use native calls with PPAPI and forbids
rest of world from using it and and even then tell others to use Pepperapi as it rhymes to npapi but expects them to use nacl in the end because pepper is not for us.Then you should clearly declare to the world that pepper is only for Adobe then.

Can you move this whole thread to https://groups.google.com/group/native-client-discuss  you said about.Or tell how to do it.Its too big to repeat or copy again.


PhistucK




PhistucK




PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsubscribe...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Rajesh Katalkar

unread,
Nov 18, 2013, 12:33:35 AM11/18/13
to chromium-...@chromium.org, Rajesh Katalkar, Joe Marini

PhistucK

unread,
Nov 18, 2013, 2:18:58 AM11/18/13
to Rajesh Katalkar, Chromium-extensions, Joe Marini
Just join the group and forward the e-mail to native-cli...@googlegroups.com, I am not familiar with any built in functionality that moves a thread across groups.


PhistucK


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Antony Sargent

unread,
Nov 18, 2013, 7:53:54 PM11/18/13
to PhistucK, Rajesh Katalkar, Chromium-extensions, Joe Marini
You could also copy/paste the link from the bottom of the email which says "To view this discusson on the web visit  https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/CABc02_LzLhVs5mCK5ziG4Akz024n7YRNAw6HLVicT7ztSFYMDA%40mail.gmail.com " - since this is an open discussion forum, you don't have to be a member to view messages. 




Reply all
Reply to author
Forward
0 new messages