I need to write plugins for the most popular browsers such as:
Google Chrome
Opera
Mozilla Firefox
Safari
Edge
Yandex Browser
The problem is:
I have to use C++, cause I'm not enough skilled in web languages. Also I'm using extra lib for C++: OpenCV. Is there any ways of creating multiplatform cross-browser plugin? I have to add, that this plugin is only for PC version of browser.
If there is no such way, please tell me, how to make plugin for each browser using C++.
Maybe you can have a look at emscripten, it translates c++ code to javascript using llvm.
Related
I am trying to add voice chat between peers using my software - desktop application to desktop application over a network. My software is compatible with Windows and OSX. The difficulty is that there seems to be very little documentation on using the native API, and all the tutorials I've come across are out of date.
I started off by building the libraries and linking them in a new project, but as I mentioned, the tutorials I have found on the Internet are several years out of date, so I didn't get far with that.
So instead I built the native code, following these instructions https://webrtc.org/native-code/development/, and have successfully used peerconnection_client and -_server, which work great.
My problem now is that the peerconnection_client is more complicated than what I need, and I'm finding it difficult extracting the relevant parts (I want to remove the GUI, connect to a peer programmatically, and only transmit audio). And even if I do manage to strip down the peerconnection_client code, to just make voice calls through a terminal, it would still be lot of code to then embed into my program because it isn't linked to libraries, but raw code.
Has anyone else tried using WebRTC for native desktop applications in this way before? Is there any up to date documentation for this I can use? Any help would be greatly appreciated.
Best solution is to use this project :
CEF project
You will get mac os, windows and linux implementation from one project.
You can always update your cef library's to stay on road.
You can also use Firefox variant :
Firefox implementation
There is a lot of other ways like :
QT framework.
https://www.qt.io/
I've worked on a couple Voice/Video/Screen over IP projects using native C++ API, and my advice is: don't do it unless you have tons of time on your hands. Native API/samples is very much abandonware - Google devs keep it in sync with Chrome, but you're on your own, you'll have to dig through WebRTC & Chrome issues and PRs when your code stops working after updating to a newer release branch.
The only documentation is the source code itself, there's plenty of comments, but it's still very hard to figure things out. And those things tend to change from one release to another
I have a c++ module written using Qt-creator SDK. I want to port this code to run on any webpage without compromising the source-code to end user. User should be able to see the output of this module on any browser(Chrome, Firefox, Safari, Explorer) without having to install any additional browser plugin. What are the better options available to achieve this. I have googled and found few such options:
Google Native client (NaCl) - But it runs only on Chrome. Is this the future of web applications??
PPAPI - Not sure if it is same as NaCl
NPAPI - almost depricated
Emscripten - It converts c++ to js. So source-code is visible to user.
WebAssembly
Are there any other options to achievce waht I am looking for? If not which one I should pick from the above options!? Many thanks in advance. a
Some clarification:
NaCl will not be supported by browsers other than Chrome. We (Google's NaCl/WebAssembly team) are more focused on WebAssembly for the future.
PPAPI is the set of APIs used by NaCl.
NPAPI: on the way out, and needs a plugin installation anyway.
Emscripten. It does compile C++ to JS, but I would not say that it reveals your source code to the user. It has been significantly transformed through the usual compilation and optimization process, and I would say it's closer to machine code than source code. In addition we are adding WebAssembly support to emscripten, so that with the same source you can produce WebAssembly for those browsers that support it, and asm.js for those that don't yet.
WebAssembly is the future, and will meet all of your criteria, with the caveat that the browser APIs and capabilities available to wasm are the same as those available to JavaScript. So you won't be able to get unlimited access to the user's filesystem, for example. All 4 major browser vendors are implementing webassembly, but it should appear in Chrome and Firefox first, because the release schedules of those browsers are uncoupled from their respective operating systems.
My suggestion would be to try porting your code with emscripten. You can start that today and use asm.js, and when WebAssembly launches, you can target that with minimal extra effort. In the future there will be other toolchains and languages that support wasm, but today emscripten is really the only ready-to-go option.
I've downloaded a nightly build of webkit which includes a dll, pdb. There are no header files and I can't find documentation on the API and usage of the dll.
I'm looking for example code to integrate this into a C++ application, and how to start requests, render them to window or ideally a Direct X texture.
So far my searching is coming up short on the webkit website and the internet at large.
You might want to check out the Chromium Embedded Framework available here: http://code.google.com/p/chromiumembedded/
I've used it extensively and found it to be functional, stable, and easy to use. It is smaller than QWebKit and has a more liberal license.
Why dont you use QWebKit from Qt? see this
I'm curious as to the procedure for writing browser plugins for browsers like Chrome, Safari, and Opera. I'm thinking specifically of Windows here and would prefer working with C++.
Are there any tools or tutorials that detail the process?
Note: I am not referring to extensions or 'addons'. I'm referring to a plugin similar to how Flash and Adobe Reader have plugins to handle specific content-types.
As others point out, plugins for those browser are written using the NPAPI.
Note: Both Firefox and Chrome will default most plugins to click-to-play soon, with Chrome planning to phase out NPAPI entirely. NPAPI for new projects is discouraged at this point.
Resources for getting started with NPAPI:
MDC plugin section
three part NPAPI tutorial
memory management in NPAPI
npsimple - the "Hello World" of NPAPI plugins
npapi-sdk - the source for the canonical NPAPI headers
Mozillas test plugin - good for looking up specific NPAPI use cases
The NPAPI itself is however relatively low-level, but there are tools and frameworks that can help you with it:
FireBreath - cross-browser, cross-platform frame-work for plugins
Nixysa - generate glue-code for NPAPI plugins
JUCE - application framework also providing support for plugins
QtBrowserPlugin - Qt based browser plugin framework
I investigated some frameworks listed by Georg, here is what I get:
FireBreath. I think it is almost the best one available. You can create a cross platform browser plugin with FireBreath in a few days. I did find some cons: It does not support utf-8 characters on Windows. For example: if there are Chinese characters in a file name, you cannot read the content of that file. I believe that boost/locale can resolve this issue. But FireBreath does not contain boost/locale. Yes you can use external boost, but I spent several days configuring and tweaking and still cannot get it compiling on Windows. The author uses cmake to orgnize code and sub-projects. And he created a lot of bat or shell scripts and cmake macros, it is very hard to understand and configure. In short, if you want something that FireBreath currently does not provide, you will have a bad luck, it is very hard to add new features.
Nixysa. I don't think that it is being actively developed. Documentation is poor. And from the comments of the wiki page: https://code.google.com/p/nixysa/wiki/HelloWorldWalkThru We can know that users could not get help at all and were having trouble get it running on Windows
JUCE. It is not specially for creating browser plugins. It does NOT support Linux. The author thinks that NPAPI is going to die so he has no plan to support Linux or add new features.
QtBrowserPlugin. You can not find it in documentation later than QT 4.5. In another word, it is not maintained(and removed from Qt 5.0)
I will update this answer once I find more.
Update: Chrome dropped NPAPI support. I think in the future it becomes harder and harder to write plugins in C++ because lacks of support from browsers.
Browsers like Netscape-based browsers, Chrome, Safari and Opera uses NPAPI plugin system, you can learn how to write NPAPI plugins in https://developer.mozilla.org/en/Plugins and http://code.google.com/chrome/extensions/npapi.html
If you know Qt then they have got some classes that makes it easier to implement browser plug-ins
I am trying to make a chrome plugin but Chrome API doesn't give me enough power. I want to use NPAPI but I have no idea how to use it but I do have experience in Visual C++.
Can someone show me a 'Hello world' in C++ application so I can get started?
Note: Both Firefox and Chrome will default most plugins to click-to-play soon, with Chrome planning to phase out NPAPI entirely. NPAPI for new projects is discouraged at this point.
NPAPI plugins shouldn't be browser specific (at least as far as possible). Seamonkeys npruntime sample can be considered a basic Hello World for NPAPI. If you care about up-to-date Mac support, you need to take a look at WebKits or Apples samples.
Reading material to get you started:
Building a FireFox plugin - 3 part introduction to NPAPI
Gecko Plugin API reference - NPAPI documentation at MDC
Mac specific info on MDC
There is also the FireBreath project: It is a framework aiming at lowering the entry barrier to browser plugin development and already takes care of most common tasks and issues.
Here is a simple cross platform example: npsimple